[Haskell-cafe] IO (Either a Error) question
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Sat May 8 02:16:25 EDT 2010
David Menendez <dave at zednenem.com> writes:
> That does not invoke fail.
>
> Let's take a simpler example: do { x <- Nothing; stmt }. This translates to
>
> let
> ok x = do { stmt }
> ok _ = fail "..."
> in Nothing >>= ok
>
> By the definition of (>>=) for Maybe, 'ok' is never called.
As I said in another email: does not the "x <- Nothing" itself call fail
as it expects x to be an actual value wrapped in Just?
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
More information about the Haskell-Cafe
mailing list