lens-2.8: Lenses, Folds and Traversals

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Inferred

Control.Lens.Combinators

Description

 

Synopsis

Documentation

(|>) :: a -> (a -> b) -> bSource

Passes the result of the left side to the function on the right side (forward pipe operator).

This is the flipped version of ($), which is more common in languages like F# where it is needed for inference. Here it is supplied for notational convenience and given a precedence that allows it to be nested inside uses of ($).

>>> "hello" |> length |> succ
6

(<$!>) :: Monad m => (a -> b) -> m a -> m bSource

A strict version of (<$>) for monads.

>>> (+1) <$!> [1,2,3,4]
[2,3,4,5]

(<$!) :: Monad m => b -> m a -> m bSource

A strict version of (<$) for monads.

>>> () <$! [1,2,3,4]
[(),(),(),()]