flow-er-1.0.3: More directional operators

Safe HaskellSafe
LanguageHaskell2010

Control.Flower.Functor.Strict

Description

 

Synopsis

Documentation

lift' :: Monad m => (a -> b) -> m a -> m b Source #

A strict version of lift

>>> lift' (+1) <| Just 0
Just 1
>>> lift' (lift' (+1)) [[1,2,3],[4,5,6]]
[[2,3,4],[5,6,7]]

over' :: (a -> b) -> a -> b Source #

Alias for apply', for readability (especially when teaching)

>>> lift' (+1) `over'` Just 0
Just 1

(<!$) :: Monad f => (a -> b) -> f a -> f b infixr 4 Source #

Operator for lift' highlighting the direction of data flow

>>> (+1) <!$ Just 0
Just 1

($!>) :: Monad f => f a -> (a -> b) -> f b infixl 4 Source #

Operator for lift' highlighting the reversed direction of data flow

>>> Just 0 $!> (+1)
Just 1