[Haskell-cafe] Re: nested maybes

J. Garrett Morris trevion at gmail.com
Mon Feb 5 09:27:44 EST 2007


On 2/5/07, Yitzchak Gale <gale at sefer.org> wrote:
> J. Garrett Morris wrote:
> > First, we'll create a transformed version of the IO monad,
>
> Why go to the trouble of creating a new monad?
> The existing ones are fine.

Mainly to keep the type error messages simpler.  A project I was
working on started with

type S = StateT Blargh (ErrorT Fizzt IO)

which was fine and dandy, although it produced somewhat verbose error
messages.  But then we added ContT to the stack, and the end result
was that error messages tended to take more time giving the
transformers than the errors.  On the other hand, using a newtype the
error messages were much easier to read.

 /g

-- 
It is myself I have never met, whose face is pasted on the underside of my mind.


More information about the Haskell-Cafe mailing list