Created
January 21, 2015 11:30
-
-
Save shigemk2/e06f5249e7cc8ecba46f to your computer and use it in GitHub Desktop.
This file contains 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
-- 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