-- 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.1.0.1 module Control.InjFun -- | 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. data InjFun i c m o -- | Create an inject function. inject :: (i -> c -> m o) -> InjFun i c m o -- | Sequencing operator. It’s a helper function that composes with -- >>= the two InjFun, respecting the order. (|->) :: Monad m => InjFun i c m o -> InjFun o c' m o' -> InjFun i (c, c') m o' -- | Explode an InjFun that outputs two values into two other -- InjFun. explode :: Monad m => InjFun i c m (o0, o1) -> (InjFun i c m o0, InjFun i c m o1) -- | Merge two InjFun into one. merge :: Monad m => InjFun i c m o -> InjFun i' c' m o' -> InjFun (i, i') (c, c') m (o, o')