<p>Forgot to copy the list. Sorry for the duplicates :(</p>
<div class="gmail_quote">On Jul 24, 2012 1:35 PM, "Tristan Seligmann" <<a href="mailto:mithrandi@mithrandi.net">mithrandi@mithrandi.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>On Jul 24, 2012 12:32 PM, "Twan van Laarhoven" <<a href="mailto:twanvl@gmail.com" target="_blank">twanvl@gmail.com</a>> wrote:<br>
><br>
> On 2012-07-24 10:10, Christian Sternagel wrote:<br>
>><br>
>> Dear all,<br>
>><br>
>> with respect to formal verification of Haskell code I was wondering whether (==)<br>
>> of the Eq class is intended to be commutative (for many classes such<br>
>> requirements are informally stated in their description, since Eq does not have<br>
>> such a statement, I'm asking here). Or are there any known cases where<br>
>> commutativity of (==) is violated (due to strictness issues)?<br>
><br>
><br>
> Strictness plays no role for Eq, since to test for equality both sides will have to be fully evaluated.</p>
<p>I don't think this is necessarily true. For example:</p>
<p>(==) :: (Eq a) => Maybe a -> Maybe a -> Bool<br>
Nothing == Nothing = True <br>
Nothing == Just _ = False<br>
Just _ == Nothing = False <br>
Just x == Just y = x == y</p>
<p>This particular example is still commutative, however (at least I think it is). </p>
</blockquote></div>