-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Monadic functions with injected parameters.
--
-- An “inject function” is a regular monadic function (like a -> m b),
-- but adds “injected parameters”. You can imagine such a function as an
-- action taking parameters (the regular monadic function parameters) and
-- vertical parameters. When you compose two compatible monadic functions
-- (the regular way is through >=>), you can choose the types of
-- the injected parameters so that, after some compositions, you have a
-- total control of all the process.
@package inject-function
@version 0.2.0.0
module Control.InjFun
-- | Function able to be injected parameters in. c is the injected
-- control parameters, i represents its input, m is the
-- resulting monad and o is the output.
data InjFun c i m o
-- | Feed a InjFun with its regular parameters and injected
-- parameters.
cfapply :: InjFun c i m o -> c -> i -> m o
-- | Create an inject function.
inject :: (c -> i -> m o) -> InjFun c i m o
-- | Sequencing operator. It’s a helper function that composes with
-- >>= the two InjFun, respecting the order. That
-- version (with a single `|`) means that both the two injected
-- parameters are considered the same; then they’re shared as a single
-- c.
(|->) :: Monad m => InjFun c i m o -> InjFun c o m o' -> InjFun c i m o'
-- | Sequencing operator. It’s a helper function that composes with
-- >>= the two InjFun, respecting the order. That
-- version (with double `|`) means that the two injected parameters are
-- considered different.
(||->) :: Monad m => InjFun c i m o -> InjFun c' o m o' -> InjFun (c, c') i m o'
-- | Explode an InjFun that outputs two values into two other
-- InjFun.
explode :: Monad m => InjFun c i m (o0, o1) -> (InjFun c i m o0, InjFun c i m o1)
-- | Merge two InjFun into one.
merge :: Monad m => InjFun c i m o -> InjFun c' i' m o' -> InjFun (c, c') (i, i') m (o, o')