proposal #4095: add Applicative instance for Either

Evan Laforge qdunkan at gmail.com
Tue Jun 1 14:09:44 EDT 2010


On Tue, Jun 1, 2010 at 8:14 AM, Yitzchak Gale <gale at sefer.org> wrote:
> Iavor Diatchki wrote:
>> Are there any uses of this instance that are not related to error
>> handing?
>
> Yes, in fact, exception handling is a minor corner case.
>
> The Either Monad/Applicative provides multi-level exit
> from nested complex computations. That effect is
> provided in a much more complicated way by callCC
> in CPS, but the straightforward way is with Either.

Can you give a specific example?  I'm trying to think of how this is
different from the normal exceptional escape mechanism.

I use Either as a Maybe + info all the time, but I think you're
talking about something more sophisticated here.


More information about the Libraries mailing list