[Haskell-cafe] ErrorT vs Either

Felipe Almeida Lessa felipe.lessa at gmail.com
Tue May 17 01:49:33 CEST 2011


On Mon, May 16, 2011 at 8:40 PM, Gracjan Polak <gracjanpolak at gmail.com> wrote:
>  result <- runErrorT $ do
>     lift $ print "was here"
>     fail "msg"
>
>  (result = Left "msg")
>
> after a while the print statement may be removed:
>
>  result <- runErrorT $ do
>     fail "msg"
>
>  (result = Left "msg")

That seems pretty unlikely for me.  If all you have is a "fail", then
there is something wrong with this code.  If there's anything besides
"fail", then removing "runErrorT" would result in a type error.

Cheers, =)

-- 
Felipe.



More information about the Haskell-Cafe mailing list