Functions

Higher-order functions

A higher-order function is one that takes a function as an argument or one which returns a function. map is a higher-order function because it takes a function as an argument. A partially applied function is higher-order because it returns a function. For example, max 2 is a higher-order function as it returns a function Integer -> Integer.

Combinators

A combinator is a higher-order operator that combines something. The $ operator is used for function application and this is a combinator.

Function composition uses the . operator which is a combinator. For example (double . double) 4 = 16 or alternatively double . double $ 4 = 16 using the function application operator.