> >  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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to