compose-trans-0.1: Composable monad transformers

Description

Basic definitions in the category `(* -> *)`.

Synopsis

# Documentation

type :-> m n = forall a. m a -> n aSource

`m :-> n` is the set of morphisms (from `m` to `n`, naturally) in our category.

newtype (t :\$ m) a Source

If `t` is an endofunctor in our category, then `t :\$ m` is basically the same as `t m`.

Constructors

 ApplyF FieldsrunApplyF :: t m a

Instances

 MonadTrans t => MonadTrans (:\$ t) (Monad m, TransM t) => Monad (:\$ t m) (MonadFix m, TransF t) => MonadFix (:\$ t m) (MonadPlus m, TransP t) => MonadPlus (:\$ t m)

newtype (t2 :. t1) m a Source

If `t1` and `t2` are endofunctorsm then `t2 :. t1` is their composition (which is also an endofunctor)

Constructors

 ComposeF FieldsrunComposeF :: (t2 :\$ (t1 :\$ m)) a

Instances

 (TransM t1, MonadTrans t2) => MonadTrans (:. t2 t1) (TransM t1, TransM t2) => TransM (:. t2 t1) (TransF t1, TransF t2) => TransF (:. t2 t1) (TransP t1, TransP t2) => TransP (:. t2 t1) (Monad m, TransM t1, TransM t2) => Monad (:. t2 t1 m) (MonadFix m, TransF t1, TransF t2) => MonadFix (:. t2 t1 m) (MonadPlus m, TransP t1, TransP t2) => MonadPlus (:. t2 t1 m)

type Inst c m = c m :-> mSource

If `m` is an algebra over an endofunctor `t`, then it's structure morphism has the type `Inst t m`.