|Copyright||Nils Anders Danielsson 2006 , Alexander Berntsen 2014|
|License||BSD-style (see the LICENSE file in the distribution)|
Simple combinators working solely on and with functions.
const x is a unary function which evaluates to
x for all inputs.
map (const 42) [0..3][42,42,42,42]
flip f takes its (first) two arguments in the reverse order of
Application operator. This operator is redundant, since ordinary application
(f x) means the same as
(f $ x). However,
$ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
fix f is the least fixed point of the function
f, i.e. the least defined
x such that
f x = x.
(*) `on` f = \x y -> f x * f y.
sortBy (compare `on` fst).
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).