#4159: move Monad and MonadFix instances for Either from mtl
to base
Ross Paterson
ross at soi.city.ac.uk
Wed Jun 30 18:57:23 EDT 2010
On Thu, Jul 01, 2010 at 12:29:57AM +0200, Claus Reinke wrote:
> As I said, even if you just want to drop 'Error', you could define
> 'fail s = Left (error s)'. That would still be less defined than the
> current instance, but more defined than the proposed instance.
That didn't occur to me -- it seems harmless enough, but it wouldn't be
enough to support pattern binding with the Either monad, would it?
> >Do you mean an overlapping instance? There are problems with that too.
>
> Yes to both. But it would avoid the problems with the unconstrained
> Monad instance for Either a, wouldn't it?
It seems disproportionate: Either is a Prelude type, and it seems reasonable
to stick to the core language in defining its instances of Prelude classes.
One can always use a new type for the Error thing.
More information about the Libraries
mailing list