compose-trans-0.0: Composable monad transformers

Control.Monad.Trans.MonadFix

Description

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

Note that each MonadFix transformer is also a Monad transformer.

Synopsis

Documentation

data MonadF m x Source

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

class TransM t => TransF t whereSource

A composable MonadFix transformer.

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

If you define instance TransF T where transFInst = instF, then you would also need to define instance MonadFix m => MonadFix (T m) somewhere in your code.

Methods

transFInst :: MonadFix m => Inst MonadF (t m)Source

Instances

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

instF :: MonadFix m => Inst MonadF mSource

A MonadFix is nothing but an algebra over the MonadF monad. instF provides it's structure map.

mfix' :: Inst MonadF m -> (x -> m x) -> m xSource

Sometimes we need an instance MonadFix T, while everything we've got is InstP MonadF T. In this case, mfix' serves as a mfix substitution.