[Haskell-cafe] Removing mtl from the Haskell Platform

wren ng thornton wren at freegeek.org
Wed May 13 00:47:38 EDT 2009

roconnor at theorem.ca wrote:
> I wanted to pass this idea around the cafe to get some thoughts before 
> submitting a trac on this topic.
> I'd like to see the mtl removed from the Haskell Platform.
> The mtl was a tremendous step forward when it was developed.  However, 
> we have learned a few things about monad transformers since the 
> development of the mtl, and it is time that we moved forward.

I would welcome a newer cleaner library to replace mtl. One caveat, in 
terms of the HP is that I'd like to see one clear alternative be 
blessed, instead of listing the alternatives. I think a big part of the 
reason many people have stuck with mtl is that they lack sufficient 
knowledge to be able to look at all the options and know which is the 
best and why, so they choose the one that is familiar.

This is similar to the Parsec problem. At the time it was introduced it 
was a major step forward, but these days there are a number of issues 
people consistently complain about. There's a large set of parser 
combinator libraries out there, but no one of them is clearly superior 
so people stick with what is familiar.

> 3) I am told by many people that the order of the state and value pair 
> in `State' is backwards.  Actually, I'm not entirely sure what the issue 
> is here, but I trust the people who say this.

Lacking type-level functions like flip, we can define the Functor ((,) 
s) easier than the reverse. This pretties type signatures up 
significantly when we start composing things[1] and doing other 
type-level programming. This is also the ordering used in dependently 
typed languages (replacing (->) with \Pi and (,) with \Sigma). Et cetera.

The current order makes the definition of (>>=) appear very marginally 
prettier, but it makes type signatures much uglier everywhere it's used.

[1] e.g. State s = Reader s . Writer s = (->) s . (,) s = /\a. s->(s,a)

Live well,

More information about the Haskell-Cafe mailing list