[Haskell-cafe] Monadic function fails as Nothing in Maybe context but as Exception in Either context.

William Yager will.yager at gmail.com
Tue Dec 1 20:35:32 UTC 2015


Oops, disregard that. Other responses didn't show up for some reason.

On Tue, Dec 1, 2015 at 2:34 PM, William Yager <will.yager at gmail.com> wrote:

> Shouldn't that be "throwError", not "fail"?
>
> --Will
>
> On Tue, Dec 1, 2015 at 12:44 PM, Jeffrey Brown <jeffbrown.the at gmail.com>
> wrote:
>
>> I spoke too soon; I'm seeing the same problem with MonadError.
>>
>>     Prelude> :set -XFlexibleContexts
>>     Prelude> import Control.Monad.Except
>>     Prelude Control.Monad.Except> let f = (fail "be Left!" :: (MonadError
>> String m) => m ())
>>     Loading package transformers-0.4.2.0 ... linking ... done.
>>     Loading package mtl-2.2.1 ... linking ... done.
>>     Prelude Control.Monad.Except> f :: Either String ()
>>     *** Exception: be Left!
>>     Prelude Control.Monad.Except>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151201/f542236f/attachment.html>


More information about the Haskell-Cafe mailing list