Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Monad m, Functor f) => MAction m f where
- mact :: m (f a) -> f a
- newtype FreeMAction m f a = FreeMAction {
- runFreeMAction :: m (f a)
Documentation
class (Monad m, Functor f) => MAction m f where Source #
A monad action is an m
-algebra parametrized over a functor f
.
This is direct translation of a monoid action in the monoidal category of
endofunctors with monoidal product: functor composition.
should be associative:
prop> mact
mact
. mact
= mact
. join
and unital:
prop> mact . return = id
There are monads which do not have any (safe) instances, like
.IO
Instances
Monad m => MAction m m Source # | |
Defined in Control.Monad.Action | |
(Monad m, FreeAlgebra m, AlgebraType m d) => MAction m (Const d :: Type -> Type) Source # | Every algebra |
(Monad m, Functor f) => MAction m (FreeMAction m f) Source # | |
Defined in Control.Monad.Action mact :: m (FreeMAction m f a) -> FreeMAction m f a Source # | |
(Pointed r, Functor f) => MAction ((->) r :: Type -> Type) f Source # | You can use |
Defined in Control.Monad.Action |
newtype FreeMAction m f a Source #
Free algebra associated with the @MAction
constraint.
FreeMAction | |
|