Copyright | Nils Anders Danielsson 2006 , Alexander Berntsen 2014 |
---|---|
License | BSD-style (see the LICENSE file in the distribution) |
Maintainer | libraries@haskell.org |
Stability | experimental |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
- Prelude re-exports
- Other combinators
Simple combinators working solely on and with functions.
Prelude re-exports
id :: a -> a
Identity function.
const :: a -> b -> a
Constant function.
(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9
Function composition.
flip :: (a -> b -> c) -> b -> a -> c
takes its (first) two arguments in the reverse order of flip
ff
.
($) :: (a -> b) -> a -> b infixr 0
Application operator. This operator is redundant, since ordinary
application (f x)
means the same as (f
. However, $
x)$
has
low, right-associative binding precedence, so it sometimes allows
parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
,
or map
($
0) xs
.zipWith
($
) fs xs
Other combinators
(&) :: a -> (a -> b) -> b infixl 1