Created
November 20, 2014 02:06
-
-
Save SamuelMarks/9872ec50204b5867374d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Test | |
import Data.Typeable | |
main :: IO () | |
main = do | |
putStrLn $ show $ double 2 | |
putStrLn $ show $ quadruple 2 | |
putStrLn $ show $ factorial 10 | |
putStrLn "Welcome to FP" | |
putStrLn $ "typeOf [\"foo\"] = " ++ show (typeOf ["foo"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Test where | |
double x = x + x | |
quadruple x = double (double x) | |
factorial n = product [1..n] | |
average ns = sum ns `div` length ns | |
somefun = a `div` length xs | |
where | |
a = 10 | |
xs = [1..5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment