
19 Sep
2006
19 Sep
'06
7:40 a.m.
Albert Lai wrote:
Deokhwan Kim
writes: Where is the Monad instance declaration of Either e?
It is in Control.Monad.Error as well. Strange: the doc doesn't state it.
Thanks a lot, Albert! I found the declaration in libraries/mtl/Control/Monad/Error.hs of the ghc source distribution: instance (Error e) => Monad (Either e) where return = Right Left l >>= _ = Left l Right r >>= k = k r fail msg = Left (strMsg msg) -- Deokhwan Kim