[Haskell-cafe] Re: Control.Exception.evaluate - 'correct
definition' not so correct
Ariel J. Birnbaum
valgarv at gmx.net
Sun May 18 15:57:43 EDT 2008
> > According to the monad law
> >
> > f >>= return = f
> >
[... snip ...]
>
> So, "(undefined >> return 2) = (return 2)"
>
*scratching head* I don't see how that's a counterexample of the monad law.
Instantiating the law for undefined would IMO yield something like:
(undefined >>= return) = \r -> return (undefined r) r
= \r -> undefined r
= undefined
(considering "undefined" as equivalent to "const undefined", which iirc was
the definition of _|_ for function types).
What am I missing?
--
Ariel J. Birnbaum
More information about the Haskell-Cafe
mailing list