MTL vs Transformers. Any status update?

Ross Paterson ross at
Sun Nov 29 08:35:30 EST 2009

On Sun, Nov 29, 2009 at 01:03:06PM +0000, Duncan Coutts wrote:
> On Sat, 2009-11-28 at 16:56 +0000, Ross Paterson wrote:
> > On Sat, Nov 28, 2009 at 04:40:49PM +0000, Duncan Coutts wrote:
> > > Could someone remind me why it's better for use to ask everyone to
> > > switch to monads-fd / transformers rather than to mtl-2? Does that make
> > > the transition easier?
> > 
> > The problem is that transformers and mtl use the same module names,
> > such as Control.Monad.Identity.  Unless one of these packages is hidden,
> > people using ghci or ghc --make will have problems.
> Right, so having transformers + mtl is bad, but why do we want to end up
> with a situation where we have both? If you've all agreed what should go
> into the new monad package, can't we call that mtl-2 ? Why would we want
> to define things in one package and re-export them in another?

Because there is not one new monad package, but two.  The idea is to
split the mtl package to decouple monad transformers from functional
dependencies.  The transformers part can then be used in Haskell 98 code,
or with type classes using type functions.  Exposed modules from mtl are
split between the resulting two packages, so neither is a replacement for
mtl-1.  As I said above, having both would be a transitional arrangement,
on the way to replacing mtl with the two packages split from it.  mtl-2
is an attempt to smooth that transition, but it would eventually go away.

More information about the Libraries mailing list