(a -> a) -> [a]
iterate f x returns an infinite list of repeated applications of f to x:
> iterate f x == [x, f x, f (f x), ...]
fix f is the least fixed point of the function f, i.e. the least defined x such that f x = x.
Apply a transformation everywhere in bottom-up manner
Apply a transformation everywhere in top-down manner
map f xs is the list obtained by applying f to each element of xs, i.e.,
> map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
> map f [x1, x2, ...] == [f x1, f x2, ...]
dropWhile p xs returns the suffix remaining after takeWhile p xs:
> dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
> dropWhile (< 9) [1,2,3] == 
> dropWhile (< 0) [1,2,3] == [1,2,3]
filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,
> filter p xs = [ x | x <- xs, p x]
takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:
> takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
> takeWhile (< 9) [1,2,3] == [1,2,3]
> takeWhile (< 0) [1,2,3] == 
until p f yields the result of applying f until p holds.
A combination of parList and map, encapsulating a common pattern:
> parMap strat f = withStrategy (parList strat) . map f
This function may be used as a value for fmap in a Functor instance.
Lift a function to actions. This function may be used as a value for fmap in a Functor instance.
The sortWith function sorts a list of elements using the user supplied function to project something out of each element
Direct MonadPlus equivalent of filter filter = (mfilter:: (a -> Bool) -> [a] -> [a] applicable to any MonadPlus, for example mfilter odd (Just 1) == Just 1 mfilter odd (Just 2) == Nothing
This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".
Put something inside an HTML element.
Show more results