<p dir="ltr">On Sep 21, 2013 9:17 AM, &quot;Bob Hutchison&quot; &lt;<a href="mailto:hutch-lists@recursive.ca">hutch-lists@recursive.ca</a>&gt; wrote:<br>
&gt; On 2013-09-21, at 4:46 AM, Stijn van Drongelen &lt;<a href="mailto:rhymoid@gmail.com">rhymoid@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I do have to agree with Damodar Kulkarni that different laws imply different classes. However, this will break **a lot** of existing software.<br>
&gt; You could argue that the existing software is already broken.</p>
<p dir="ltr">I&#39;d argue that it&#39;s not all broken, and you&#39;re breaking it all. </p>
<p dir="ltr">&gt;&gt; If we would do this, only Eq and Ord need to be duplicated, as they cause most of the problems. Qualified imports should suffice to differentiate between the two.<br>
&gt;&gt;     import qualified Data.Eq.Approximate as A<br>
&gt;&gt;     import qualified Data.Ord.Approximate as A<br>
&gt;&gt;<br>
&gt;&gt;     main = print $ 3.16227766016837956 A.== 3.16227766016837955<br>
&gt; As soon as you start doing computations with fp numbers things get much worse. </p>
<p dir="ltr">Exactly. The Eq and Ord instances aren&#39;t what&#39;s broken, at least when you&#39;re dealing with numbers (NaNs are another story). That there are pairs of non-zero numbers that when added result in one of the two numbers is broken. That addition isn&#39;t associative is broken. That expressions don&#39;t obey the substitution principle is broken. But you can&#39;t tell these things are broken until you start comparing values. Eq and Ord are just the messengers. <br>

</p>