The compose-trans package
A version of monad transformers that (a) allows one to convince the type checker that transformer application is a monad, and (b) doesn't need lots of boilerplate to add a new transformer. It's supposed to play nicely with Control.Monad.Trans.
In order to make a new transformer (say, T) an instance of TransM (TransP, TransF) class, all you have to do is:
define instance MonadTrans T — which you've probably done already
define instance Monad m => Monad (T m) — also something quite common (for TransP and TransF you'd need another instance for MonadPlus and MonadFix, respectively).
write instance Trans T where transMInst = instM — which is exactly one line of boilerplate. Sorry for that.
After that, you can use your new and shiny transformer in compositions, like ReaderT Char :. T :. WriterT String — and such a composition would automagically become a monad transmormer.
Properties
| Versions | 0.0, 0.1 |
|---|---|
| Dependencies | base (≥2 & ≤4), mtl |
| License | BSD3 |
| Author | Miguel Mitrofanov |
| Maintainer | miguelimo38@yandex.ru |
| Category | Monads |
| Upload date | Mon Aug 17 04:13:54 UTC 2009 |
| Uploaded by | MiguelMitrofanov |
| Built on | ghc-6.10, ghc-6.12 |
| Build failure | ghc-7.0 (log), ghc-7.4 (log) |
Modules
Downloads
- compose-trans-0.0.tar.gz (Cabal source package)
- package description (included in the package)