[Haskell-cafe] Monad laws

Rafael Almeida almeidaraf at gmail.com
Wed Jun 25 03:54:03 UTC 2014


Hello,

You guys have been great taking my questions. Thank you. Now I have another
one :)

What can go wrong if I make an Monad instance but don't follow Monad rules
(identity and associativity)? Sure it would be misleading for someone using
the non-conforming class. They may make code that assume those laws,
although they don't hold. However, could it make the compiler generate bad
code or some standard functions to behave badly or even break?

[]'s
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140625/b76e3665/attachment.html>


More information about the Haskell-Cafe mailing list