
1 Jun
2010
1 Jun
'10
11:14 a.m.
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. Unfortunately, Either is not commonly used in that general way in Haskell because it was hijacked early on by the very unfortunate orphan instance in Control.Monad.Error which imposes a gratuitous superclass condition. Regards, Yitz