| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.Module
Description
Synopsis
- class (Functor f, Monad m) => Module f m where
- mjoin :: Module f m => f (m a) -> f a
- transAction :: (MonadTrans t, Monad m, Monad (t m)) => t m a -> (a -> m b) -> t m b
- composeAction :: (Functor f, Monad m) => Compose f m a -> (a -> m b) -> Compose f m b
Documentation
class (Functor f, Monad m) => Module f m where Source #
f is right m-module. (according to https://ncatlab.org/nlab/show/module+over+a+monad#modules definitions).
We have natural transformation.Compose f m ~> f
Laws
fma>>==return = fma fma>>==(f>=>g) = (fma>>==f)>>==g
Properties
For all we can write associated Monad minstance .Module m m where (>>==) = (>>=)
mjoin and >>== are equivalent in power:
fa>>==amb =mjoin(fmapamb fa)
Minimal complete definition
transAction :: (MonadTrans t, Monad m, Monad (t m)) => t m a -> (a -> m b) -> t m b Source #
action's implementation.Module m (t m)