Skip to content

Instantly share code, notes, and snippets.

@chomado
Last active December 18, 2015 14:19
Show Gist options
  • Save chomado/5796288 to your computer and use it in GitHub Desktop.
Save chomado/5796288 to your computer and use it in GitHub Desktop.
-- double x = x + x
double = \x -> x + x
--add x y = x + y
add = \x -> (\y -> x + y)
-- カリー化された関数 mult :: Num a => a -> a -> a -> a
-- mult x y z = x * y * z は、λ式を用いるとどのように表現できるか
mult :: Int -> ( Int -> ( Int -> Int ))
mult = \x -> (\y -> (\z -> x * y * z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment