<div dir="ltr"><div>I wanted this too when I first got into Haskell, but ultimately it comes down to not being semantically correct here.</div><div><br></div><div>NaN /= NaN, so referential equality of anything that might ever compare inside two NaN's doesn't imply value equality. </div>
<div><br></div><div><div>e.g. Anything with a polymorphic field can't use this.<br></div></div><div><br></div><div>You can argue that that was a bad call, but it was the expected call under IEEE semantics.</div><div><br>
</div><div>If you wanted to bubble up some kind of extra 'reflexive :: a -> Bool' through the Eq instance, then the tricky part is that determining if you can use this can be as bad as doing the full tree comparison for pathological cases you can construct and can introduce bottoms where there previously were none if you do it naively.<br>
</div><div><br></div><div>You also start getting weird cases where things turn into Heisenbugs. this == that would terminate before you evaluate this or that, but if you evaluate one or the other then sometimes it works.</div>
<div><br></div><div>-Edward</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 20, 2014 at 11:14 AM, Iustin Pop <span dir="ltr"><<a href="mailto:iusty@k1024.org" target="_blank">iusty@k1024.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Aug 20, 2014 at 03:16:03PM +0200, Johan Holmquist wrote:<br>
</div><div class="">> To summarise, the points raised sofar against this optimisation are,<br>
> roughly, as follows.<br>
<br>
</div>I think a different aspect of this is: what are you trying to optimise?<br>
What code do you have where equality tests are a significant part of the<br>
workload?<br>
<br>
regards,<br>
iustin<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>