<br><br><div class="gmail_quote">On Thu, Jun 21, 2012 at 7:00 AM, George Giorgidze <span dir="ltr">&lt;<a href="mailto:giorgidze@gmail.com" target="_blank">giorgidze@gmail.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
&gt;<br>
&gt; Regarding antisymmetry, if I also define<br>
&gt;<br>
&gt; instance Ord Foo where<br>
&gt;   (==) = (==) `on` a<br>
&gt;<br>
&gt; then would that count as satisfying the law?<br>
<br>
</div>Probably, you mean here Eq instead of Ord.<br>
<br>
If a &lt;= b and b &lt;= a then a = b (antisymmetry)<br>
<br>
It all depends on what one means by &quot;=&quot;. Opinions differ on this, see<br>
[1]. If we mean &quot;==&quot;, which is a function to Bool, from the Eq class,<br>
then it does satisfy the antisymmetry law.<br>
<br>
But in this case, the question arises what are the laws that Eq<br>
instances should satisfy.<br>
<br>
Should it be that x == y implies x = y? But once again what does &quot;=&quot;<br>
mean here. It depends on who you ask (once again see [1]).<br>
<br></blockquote><div><div><br>These nits don&#39;t need to be picked.  The theory of equivalence relations is extremely well understood.  This is a topic covered by the sophomore mathematics level.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>But, my opinion is that if you can write a pure function f that can<br>

tell them apart (i.e., f x /= f y), I find it a very strange notion of<br>equality.</blockquote><div><br></div><div>There&#39;s your problem.  It is straight-forward to generate an equivalence relation that can tell things apart with respect to a different equivalence relation.  Equivalence relations do not need to agree!</div>
<div><br></div><div>If you really want to keep distinct equivalence relations apart semantically, just use a newtype wrapper to explicitly &quot;name&quot; the relation.</div>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am not saying that this is a trivial undertaking, but would be a<br>
more principled approach. It would require the Haskell community and,<br>
especially, standard library and language specification developers to<br>
agree on a suitable notion of equality that Eq instances should<br>
satisfy.<br></blockquote><div><br></div><div>That has already happened.  A relation merely has to satisfy the equivalence relation axioms.</div></div>