free-algebras-0.1.0.0: Free algebras

Synopsis

# 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.

mact should be associative: prop> mact . mact = mact . join and unital: prop> mact . return = id

There are monads which do not have any (safe) instances, like IO.

Methods

mact :: m (f a) -> f a Source #

Instances
 Monad m => MAction m m Source # Instance detailsDefined in Control.Monad.Action Methodsmact :: m (m a) -> m a Source # (Monad m, Functor f) => MAction m (FreeMAction m f) Source # Instance detailsDefined in Control.Monad.Action Methodsmact :: m (FreeMAction m f a) -> FreeMAction m f a Source # (Monad m, FreeAlgebra m, AlgebraType m d) => MAction m (Const d :: Type -> Type) Source # Every algebra d which satisfies the constraint AlgebraType m d lifts to an action on the constant functor Const d. This is the same as to say that d is an m-algebra (as of f-algebras in category theory). Instance detailsDefined in Control.Monad.Action Methodsmact :: m (Const d a) -> Const d a Source # (Pointed r, Functor f) => MAction ((->) r :: Type -> Type) f Source # You can use PointedMonoid newtype wrapper if you want to laverage Pointed instance for a Monoid. Instance detailsDefined in Control.Monad.Action Methodsmact :: (r -> f a) -> f a Source #

newtype FreeMAction (m :: Type -> Type) (f :: Type -> Type) a Source #

Free algebra associated with the @MAction constraint.

Constructors

 FreeMAction FieldsrunFreeMAction :: m (f a)
Instances