Description
Simple combinators working solely on and with functions.
Synopsis
(.) :: (b -> c) -> (a -> b) -> a -> cSource
Function composition.
flip :: (a -> b -> c) -> b -> a -> cSource
takes its (first) two arguments in the reverse order of flip
ff
.
($) :: (a -> b) -> a -> bSource
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
is the least fixed point of the function fix
ff
, i.e. the least defined x
such that f x = x
.
on :: (b -> b -> c) -> (a -> b) -> a -> a -> cSource
(*) `on` f = \x y -> f x * f y
.
Typical usage:
.sortBy
(compare
`on` fst
)
Algebraic properties:
(*) `on` id
= (*)
(if (*) ∉ {⊥, const
⊥}
)((*) `on` f) `on` g = (*) `on` (f . g)
flip
on f .flip
on g =flip
on (g . f)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4