Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (Monad m, Functor f) => MAction m f where
- mact :: m (f a) -> f a
- newtype FreeMAction (m :: Type -> Type) (f :: Type -> Type) 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) f Source # | You can use |
Defined in Control.Monad.Action |
newtype FreeMAction (m :: Type -> Type) (f :: Type -> Type) a Source #
Free algebra associated with the @MAction
constraint.
FreeMAction | |
|