
22 Jan
2012
22 Jan
'12
9:49 a.m.
On Sat, Jan 21, 2012 at 8:09 PM, David Barbour
In any case, I think the monad identity concept messed up. The property: return x >>= f = f x
Logically only has meaning when `=` applies to values in the domain. `undefined` is not a value in the domain.
We can define monads - which meet monad laws - even in strict languages.
In strict languages both `return undefined >>= f` and `f undefined` are observably equivalent to `undefined` so the law holds. In a lazy language both sides might be observably different from `undefined` but need to be consistently so. The point of equational laws is that one can replace one side with the other without observing a difference. Your implementation of `StrictT` violates this principle. Sebastian