
7 Sep
2006
7 Sep
'06
10:49 a.m.
On 9/6/06, Deokhwan Kim
What is the practical meaning of monad laws?
A compiler may re-write any monadic computations, for efficiency or other reasons, under the assumption that the monad laws are valid. If the monad laws aren't valid, this re-writing produces a different function than the programmer wrote. Even though compilers aren't required to be "aware" of the monad laws, other programmers are. So, even if your compiler doesn't do any re-writing, another programmer who works on your code may essentially do the same thing. Hope this helps! --Tom Phoenix