Albert Lai wrote: > Deokhwan Kim <[EMAIL PROTECTED]> 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 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe