flow-er-1.0.3: More directional operators

Safe HaskellSafe
LanguageHaskell2010

Control.Flower.Applicative.Lazy

Description

 

Synopsis

Documentation

ap :: Applicative f => f (a -> b) -> f a -> f b Source #

A simple alias for <*>

>>> ap (Just (+1)) (Just 4)
Just 5

lift2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c Source #

An alias for lift2, updating with unified "lift" naming

>>> lift2 (+) (Just 4) (Just 1)
Just 5

lift3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #

An alias for lift3, updating with unified "lift" naming

>>> lift3 (\x y z -> x * y * z) (Just 4) (Just 3) (Just 2)
Just 24

(<*) :: Applicative f => f (a -> b) -> f a -> f b infixr 4 Source #

Right-associative, left-flowing applicative operator

>>> Just (+1) <* Just 4
Just 5

(*>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 Source #

Left-associative, right-flowing applicative operator

>>> Just 4 *> Just (+1)
Just 5

(<$*) :: Applicative f => (a -> b -> c) -> f a -> f b -> f c infixr 4 Source #

Right-associative, left-flowing lift2 operator

>>> (+) <$* Just 4 |< Just 1
Just 5

(*$>) :: Applicative f => f a -> (a -> b -> c) -> f b -> f c infixl 4 Source #

Left-associative, right-flowing lift2 operator

>>> Just 4 >| Just 1 *$> (+)
Just 5

(<$**) :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d infixr 4 Source #

Right-associative, left-flowing lift3 operator

>>> (\x y z -> x * y * z) <$** Just 4 |< Just 3 |< Just 2
Just 24

(**$>) :: Applicative f => f a -> (a -> b -> c -> d) -> f b -> f c -> f d infixl 4 Source #

Left-associative, right-flowing lift3 operator

>>> Just 2 >| Just 3 >| Just 4 **$> \x y z -> x * y * z
Just 24