#4159: move Monad and MonadFix instances for Either from mtl to base

John Lato jwlato at gmail.com
Fri Jul 2 08:13:53 EDT 2010

> From: Ross Paterson <ross at soi.city.ac.uk>
> On Thu, Jul 01, 2010 at 11:35:24AM +0100, Simon Marlow wrote:
>> I don't know all the ins and outs of the discussion here, but before
>> proposing to reverse this decision someone should do a careful
>> assessment of the prior rationale and results of subsequent
>> experience.
> The general question of fail is a side issue -- the question here is
> just whether the Monad instance for Either should define fail, and if
> so to what.

I think it should not define fail (or define it to error).  I've never
been happy with the semantics of this instance.  I thought the point
of Either was that neither value had any special meaning attached to
it, and in particular that "Left" and "Right" were chosen as being
free of any connotations of correct, incorrect, or other.  Defining
fail as "Left x" seems wrong because it codifies the left value as an
error.  In my opinion those semantics belong to another type.


More information about the Libraries mailing list