AddBounds makes total orders from total orders.&nbsp; It just adds new least and greatest elements.<br><br>The problem with the derived instance is that it doesn&#39;t exploit the potential laziness of min on &#39;a&#39;.&nbsp; Because of their types, min it can produce partial info from partial info and (&lt;=) and compares cannot.<br>
<br>&nbsp; - Conal<br><br><div class="gmail_quote">On Thu, Mar 20, 2008 at 2:00 AM, Christian Maeder &lt;<a href="mailto:Christian.Maeder@dfki.de">Christian.Maeder@dfki.de</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Conal Elliott wrote:<br>
&gt; I have an algebraic data type (not newtype) that derives Ord:<br>
&gt;<br>
&gt; &nbsp; &nbsp; data AddBounds a = MinBound | NoBound a | MaxBound<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; deriving (Eq, Ord, Read, Show)<br>
<br>
</div>The class Ord is not suited for partial orders. If you write your own<br>
Ord instances anyway, I&#39;d suggest to introduce a proper new class (say<br>
Lattice), too!<br>
<br>
I hope that the computation of &quot;uncomparable&quot; does terminate in your<br>
case. Maybe the lattice operation &quot;join and &quot;meet&quot; are even more<br>
appropriate than &quot;min&quot; and &quot;max&quot;.<br>
<br>
However, if your type parameter &quot;a&quot; has a total order, the above derived<br>
instance looks correct.<br>
<br>
HTH Christian<br>
<br>
</blockquote></div><br>