Skip to main content

Currying

Todo

The -> is a right associative, so Int -> Int -> Int -> Int is the same as Int -> (Int -> (Int -> Int)).

Rule This gives us the "lambda distribution rule":

add :: Int -> Int -> Int
add x y = x + y
{- means -}
add :: Int -> (Int -> Int)
add = \x -> (\y -> x + y) -- where `\` is the keyboard symbol for the lambda symbol.

A function that has all of its expected arguments is saturated and can evaluate to a non-function value. Otherwise it's considered partially applied. Lemma