Probably because in the instance of Monad Either, fail has not been
overloaded, and still has its default implementation:
fail = error
Whereas runErrorT explicitely catches the exception.


2011/5/16 Gracjan Polak <gracjanpo...@gmail.com>

>
> Hi all,
>
> A why question: Why:
>
> Control.Monad.Error Prelude> runErrorT (fail "msg") :: IO (Either String
> Int)
> Left "msg"
>
> but
>
> Control.Monad.Error Prelude> (fail "msg") :: (Either String Int)
> *** Exception: msg
>
> ?
>
> --
> Gracjan
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to