Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created January 21, 2015 11:30
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 shigemk2/e06f5249e7cc8ecba46f to your computer and use it in GitHub Desktop.
Save shigemk2/e06f5249e7cc8ecba46f to your computer and use it in GitHub Desktop.
-- multiThree :: Int -> Int -> Int -> Int
-- こういう書き方もできるお
multiThree :: Int -> (Int -> (Int -> Int))
-- multiThree a b c = a * b * c
multiThree = \x -> \y -> (\z -> x * y * z)
compareWithHundred :: Int -> Ordering
compareWithHundred x = compare 100 x
compareWithHundred' :: Int -> Ordering
-- compare :: (Ord a) => -> (a -> Ordering)
compareWithHundred' = compare 100
main = do
-- multiThree
print $ multiThree 3 4 5
let multi2with9 = multiThree 9
print $ multi2with9 4 5
-- conpareWithHundred
print $ compareWithHundred 99
print $ compareWithHundred' 101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment