compose-trans-0.0: Composable monad transformers

Control.Monad.Trans.MonadPlus

Description

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

Note that each MonadPlus transformer is also a Monad transformer.

Synopsis

Documentation

data MonadP m x Source

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

class TransM t => TransP t whereSource

A composable MonadPlus transformer.

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

If you define instance TransP T where transPInst = instP, then you would also need to define instance MonadPlus m => MonadPlus (T m) somewhere in your code.

Methods

transPInst :: MonadPlus m => Inst MonadP (t m)Source

Instances

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

instP :: MonadPlus m => Inst MonadP mSource

A MonadPlus is nothing but an algebra over the MonadP monad. instP provides it's structure map.

mzero' :: Inst MonadP m -> m xSource

Sometimes we need an instance MonadPlus T, while everything we've got is InstP MonadP T. In this case, mzero' serves as a mzero substitution.

mplus' :: Inst MonadP m -> m x -> m x -> m xSource

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