Skip to content

Instantly share code, notes, and snippets.

@pb10005
Last active April 20, 2017 07:57
Show Gist options
  • Save pb10005/923bab7cd255cd91934989e1b66c182e to your computer and use it in GitHub Desktop.
Save pb10005/923bab7cd255cd91934989e1b66c182e to your computer and use it in GitHub Desktop.
--Haskellでラムダ
--syntax sugar
mul = \x y -> x * y
mul' = \x -> \y -> x * y
main = do
--束縛せずに書ける
print $ (\x -> \y -> x*y) 4 5
--カリー化
print $ mul 4 5
print $ mul' 4 5
print $ (mul 4) 5
print $ (mul' 4) 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment