
Hugh Perkins wrote:
On 7/14/07, *Andrew Coppin*
That is my recollection also. (Don't ask me *which* monads, mind you...) In the case in point, the law breakage never the less matches "intuition"; personally, I ignore the monad laws on the basis that if you're doing something "sane", the laws will automatically hold anyway. (But maybe I'm just a renegade?)
Yeah, the laws confused me for a while as well. Hint to guys writing Haskell documentation, we're not all doing CS phD you know ;-) We just want to get things done ;-)
Andrew, I found comfort and explanation in this article http://www.haskell.org/haskellwiki/Monads_as_containers :
"The functions return and bind need to satisfy a few laws http://www.nomaware.com/monads/html/laws.html#laws in order to make a monad, but if you define them in a sensible way given what they are supposed to do, the laws will work out. The laws are only a formal way to give the informal description of the meanings of return and bind I have here."
Oh, I *understand* the laws - I just think that if you're trying to explain how to *use* (not *write*) monads, you really don't need to emphasize this "laws" business. IMHO...