[Haskell-cafe] Monad laws

Rafael Almeida almeidaraf at gmail.com
Sun Jun 29 03:38:44 UTC 2014


On Sun, Jun 29, 2014 at 12:11 AM, Brandon Allbery <allbery.b at gmail.com>
wrote:

> On Sat, Jun 28, 2014 at 10:59 PM, Rafael Almeida <almeidaraf at gmail.com>
> wrote:
>
>> What is there to be gained by such a law which can't be enforced by the
>> compiler?
>
>
> There are lots of things that can't be enforced by the compiler; for
> example, it can't force you to write an Ord instance that implements a
> correct total ordering. Does this make Ord less useful to you? Or pointless?
>

No. I'm not trying to say Monad laws are useless or pointless. Rather, I am
looking to understand the usefulness of those laws.

People are indeed going to expect that the < operator is transitive. Even
though the compiler can do nothing about it. I'm not sure how to explain
why we need < to be transitive. If you do so, please explain that to me as
well. I always took it for granted that such law must be obeyed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140629/054cbe55/attachment.html>


More information about the Haskell-Cafe mailing list