compose-trans-0.1: Composable monad transformers

Control.Monad.Trans.Monad

Description

Monad transformers. There are also MonadPlus and MonadFix transformes, see the corresponding modules.

Synopsis

Documentation

data MonadM m x Source

MonadM m is actually a free monad generated by m. MonadM is a monad itself (on the (* -> *) category), as usually happens with free structures.

class MonadTrans t => TransM t whereSource

A composable monad transformer.

Methods

transMInst :: Monad m => Inst MonadM (t m)Source

You shoudn't (and probably can't) use *anything* except for instM, defined in this very module, as transMInst.

If you define instance TransM T where transMInst = instM, then you would also need to define instance Monad m => Monad (T m) somewhere in your code.

Instances

TransM ListT 
TransM (ContT c) 
TransM (ReaderT r) 
TransM (StateT s) 
Monoid w => TransM (WriterT w) 
(TransM t1, TransM t2) => TransM (:. t2 t1) 

instM :: Monad m => Inst MonadM mSource

A monad is nothing but an algebra over the MonadM monad. instM provides it's structure map.

return' :: Inst MonadM m -> x -> m xSource

Sometimes we need an instance Monad T, while everything we've got is Inst MonadP T. In this case, return' serves as a return substitution.

bind' :: Inst MonadM m -> m x -> (x -> m y) -> m ySource

Sometimes we need an instance Monad T, while everything we've got is Inst MonadP T. In this case, bind' serves as a >>= substitution.