Skip to content

Instantly share code, notes, and snippets.

@SamuelMarks
Created November 20, 2014 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamuelMarks/9872ec50204b5867374d to your computer and use it in GitHub Desktop.
Save SamuelMarks/9872ec50204b5867374d to your computer and use it in GitHub Desktop.
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"])
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