lens-3.7.3: Lenses, Folds and Traversals

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

Control.Lens.Combinators

Description

 

Synopsis

Documentation

(<$!>) :: 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]
[(),(),(),()]

(<&>) :: Functor f => f a -> (a -> b) -> f bSource

Infix flipped fmap.

(<&>) = flip fmap

(??) :: Functor f => f (a -> b) -> a -> f bSource

This is convenient to flip argument order of composite functions

>>> over _2 ?? ("hello","world") $ length
("hello",5)
>>> over ?? length ?? ("hello","world") $ _2
("hello",5)