proposal #4095: add Applicative instance for Either

Yitzchak Gale gale at sefer.org
Tue May 25 13:27:03 EDT 2010


I wrote:
>>> -1 for the orphan Monad instance with the silly
>>> superclass constraint that this Applicative instance
>>> is meant to extend

Henning Thielemann wrote:
>> I assume you are referring to...
>> defined in Control.Monad.Trans.Error from transformers or
>> Control.Monad.Error from mtl.

Indeed.

> I think the problem with this instance is that it is orphan.

That's one problem - and a serious one.

The other problem is the superclass restriction.
That only makes sense in the context of mtl
or transformers. But the Either monad is far more
generally useful than that. mtl should have defined
a its own type instead of using up the Monad slot for
the Prelude Either type.

Regards,
Yitz


More information about the Libraries mailing list