Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created Jan 21, 2015
Embed
What would you like to do?
-- 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