
17 Aug
2009
17 Aug
'09
1:06 a.m.
Just uploaded compose-trans-0.0 to Hackage. 'compose-trans' is a small library intended to make monad transformers composable. It provides a class TransM, derived from MonadTrans, which is closed under composition - that is, if t1 and t2 are instances of TransM, then (t2 :. t1) is also an instance of TransM (and, therefore, an instance of MonadTrans), and the type ((t2 :. t1) m x) is isomorphic to (t2 (t1 m) x). It's fairly easy to make a new transformer an instance of TransM; it only takes one short line of code. There are also TransP and TransF classes, that help dealing with MonadPlus and MonadFix instances.