The issue is more than just efficiency.&nbsp; It&#39;s vital that these improving values get evaluated as little as possible.&nbsp; In my use for functional reactivity, they represent the times of future event occurrences.&nbsp; <br><br>
Your (&lt;=)-via-min idea might work in some cases, though useful pointer equality can be pretty tricky in the presence of laziness.&nbsp; It&#39;s one thing to use pointer equality in lazy memo functions, where false
negatives are okay, but in this case, a false negative (pointer
inequality between semantically equal values) would give the wrong
answer for min.&nbsp; Also, the assumption that min returns one of its arguments is questionable.&nbsp; It&#39;s certainly not the case in Warren Burton&#39;s implementation of improving values (refs in previous mail).&nbsp; Instead, min merges the lower bounds from each argument into the result.&nbsp; Of course min returns a value semantically equal to one of its arguments, but a pointer-equality test would fail, and a semantic equality test would block.<br>
<br>Cheers,&nbsp; - Conal<br><br><div class="gmail_quote">On Mon, Mar 31, 2008 at 1:34 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">Christian Maeder wrote:<br>
&gt; Conal Elliott wrote:<br>
&gt;&gt; The type argument I ran into trouble with represents a value as a list<br>
&gt;&gt; of increasing lower bounds, ending in the exact value. &nbsp;min produces<br>
&gt;&gt; lower bounds from lower bounds and so is immediately productive before<br>
&gt;&gt; even knowing which argument is the lesser one.<br>
&gt;<br>
&gt; Is this only a matter of efficiency? Can it be compared with a faster<br>
&gt; equality check that does not need to evaluate terms always, because it<br>
&gt; compares the internal pointers first (and returns True for equal ones)?<br>
&gt;<br>
<br>
</div>Because min returns one of its arguments, &quot;&lt;=&quot; could be defined in terms<br>
of &quot;min&quot; and equality.<br>
<br>
 &nbsp;a &lt;= b = min a b == a<br>
<br>
&quot;==&quot; would cause further evaluations, but if an equality could look up<br>
pointers (to unevaluated thunks) no further evaluation might be<br>
necessary, so that min and &lt;= do basically the same.<br>
<div><div></div><div class="Wj3C7c"><br>
&gt; Cheers Christian<br>
&gt;<br>
&gt; P.S. Maybe it is still a good idea to have a separate user defined class<br>
&gt; &nbsp;Min for your purpose, because then you don&#39;t have to hand-write compare<br>
&gt; functions, but then I don&#39;t know the nesting of your data types, though<br>
&gt; a generic instance Ord a =&gt; Min a may help.<br>
&gt;<br>
</div></div></blockquote></div><br>