(a -> b -> c) -> b -> a -> c -containers
flip f takes its (first) two arguments in the reverse order of f.
foldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:
> foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
Fold over the elements of a structure, associating to the right, but strictly.
Fold over the elements of a structure, associating to the left, but strictly.
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
> foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
The list must be finite.
A strict version of foldl.
Consume the chunks of a lazy Text with a natural right fold.
Consume the chunks of a lazy Text with a strict, tail-recursive, accumulating left fold.
scanr is the right-to-left dual of scanl. Note that
> head (scanr f z xs) == foldr f z xs.
scanl is similar to foldl, but returns a list of successive reduced values from the left:
> scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
Note that
> last (scanl f z xs) == foldl f z xs.
zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two lists to produce the list of corresponding sums.
Lift a binary function to actions.
Promote a function to a monad, scanning the monadic arguments from left to right. For example,
> liftM2 (+) [0,1] [0,2] = [0,2,1,3]
> liftM2 (+) (Just 1) Nothing = Nothing
O(n) foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a Text, reduces the Text using the binary operator, from left to right. Subject to fusion.
O(n) A strict version of foldl. Subject to fusion.
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right.
Show more results