<div dir="ltr">This in response to a comment on a GHC ticket [1]. I thought it was interesting enough to warrant general discussion.<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Comment (by JeremyShaw):<br>
<br><div class="Ih2E3d">&nbsp;&gt; Also, where does the H98 report say all instances of Eq must be<br>
&nbsp;transitive, reflexive, symmetric, and antisymmetric? It just says &quot;The Eq<br>
&nbsp;class provides equality (==)..&quot;, whatever that might mean :-)<br>
<br>
</div>&nbsp;Well, it does not say it explicitly, but I suspect H98&#39;s usage of Eq<br>
&nbsp;implicitly demands those laws be followed.</blockquote><div><br>Indeed. The same goes for the implicit law that (x /= y) /= (x == y), since both (/=) and (==) can be overridden. [2]<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hopefully in Haskell&#39; the laws<br>
&nbsp;will not only be stated, but there will be some QuickCheck-style<br>
&nbsp;properties you can use to test your own instances ;)</blockquote><div><br>This is an interesting thought. Has there been any work towards collecting properties written with QuickCheck (or similar) into a reusable chunk of some form? It would be very convenient to have parametrized properties that tested implicit laws such as equality, monads, and other things that come with the Haskell Platform. Not only would such a library be useful to use, but it would provide a number of readily available examples for would-be testers, thus encouraging testing.<br>
<br>Sean<br><br>[1] <a href="http://hackage.haskell.org/trac/ghc/ticket/2528#comment:6">http://hackage.haskell.org/trac/ghc/ticket/2528#comment:6</a><br>[2] <a href="http://www.haskell.org/tutorial/monads.html#sect9.1">http://www.haskell.org/tutorial/monads.html#sect9.1</a><br>
</div></div></div>