inject-function-0.1.0.1: Monadic functions with injected parameters.

Safe HaskellSafe-Inferred

Control.InjFun

Contents

Synopsis

Inject function

data InjFun i c m o Source

Function able to be injected parameters in. i represents its input, c is the injected control parameters, m is the resulting monad and o is the output.

inject :: (i -> c -> m o) -> InjFun i c m oSource

Create an inject function.

Sequencing, exploding and merging

(|->)Source

Arguments

:: Monad m 
=> InjFun i c m o

First function

-> InjFun o c' m o'

Second function

-> InjFun i (c, c') m o'

Resulting sequencing function

Sequencing operator. It’s a helper function that composes with >>= the two InjFun, respecting the order.

explodeSource

Arguments

:: Monad m 
=> InjFun i c m (o0, o1)

Function to explode

-> (InjFun i c m o0, InjFun i c m o1)

Exploded functions

Explode an InjFun that outputs two values into two other InjFun.

mergeSource

Arguments

:: Monad m 
=> InjFun i c m o

First function

-> InjFun i' c' m o'

Second function

-> InjFun (i, i') (c, c') m (o, o')

Merged function

Merge two InjFun into one.