
18 May
2008
18 May
'08
7:57 p.m.
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