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

Ross Paterson ross at soi.city.ac.uk
Thu Jul 1 05:38:29 EDT 2010

On Thu, Jul 01, 2010 at 11:18:22AM +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?
> Only partially - sufficient to use it for MonadPlus mzero composition
> or for MonadError early exit, but not sufficient to make use of the
> error information (essentially, we model 'Either Void b' on 'Maybe b').

I thought so -- that functionality is already available in the Monad
instance for Maybe.

> those who want Either with different uses should
> use a different Either-like type.

I think we all agree on that.  (We only differ on whose are the
"different uses".)

More information about the Libraries mailing list