[Haskell] Long live Edison

ajb at spamcop.net ajb at spamcop.net
Tue Feb 21 00:16:25 EST 2006

G'day all.

Quoting Cale Gibbard <cgibbard at gmail.com>:

> One thing which I found odd about the NotJustMaybe pattern is that not
> much is really gained apart from a small amount of convenience.

That's not the whole truth.  It buys you abstraction, in that the library
function can signal an error without caring what specific mechanism is
used to support it.

> Further, if the inconvenience of doing that embedding is
> still too great, we have the typeclass MonadError to differentiate
> between monads with and without failure mechanisms -- perhaps it could
> be cleaned up a bit in a few ways, but I think the idea is right.

That's also possible.  MonadError is designed so that errors can be
caught.  Maybe this is not the most important feature.

Andrew Bromage

More information about the Haskell mailing list