Tutorial by Examples

Review Partial Application before proceeding. In Haskell, a function that can take other functions as arguments or return functions is called a higher-order function. The following are all higher-order functions: map :: (a -> b) -> [a] -> [b] filter :: (a -> Bool) -> [a] ...
Lambda expressions are similar to anonymous functions in other languages. Lambda expressions are open formulas which also specify variables which are to be bound. Evaluation (finding the value of a function call) is then achieved by substituting the bound variables in the lambda expression's body, ...
In Haskell, all functions are considered curried: that is, all functions in Haskell take just one argument. Let's take the function div: div :: Int -> Int -> Int If we call this function with 6 and 2 we unsurprisingly get 3: Prelude> div 6 2 3 However, this doesn't quite behave in...

Page 1 of 1