In OCaml you have sort and fastsort - the latter doesn&#39;t have to be stable. It currently is, because fastsort = sort.<br>I think it is a good thing to leave people an option, if there is something important to choose.<br>
<br><div class="gmail_quote">On Thu, Mar 13, 2008 at 12:48 AM,  &lt;<a href="mailto:ajb@spamcop.net">ajb@spamcop.net</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;">
G&#39;day all.<br>
<div class="Ih2E3d"><br>
Adrian Hey wrote:<br>
<br>
&gt;&gt; This might be a reasonable thing to say about *sortBy*, but not sort<br>
&gt;&gt; as the ordering of equal elements should not be observable (for any<br>
&gt;&gt; correct instance of Ord). It should be impossible to implement a<br>
&gt;&gt; function which can discriminate between [a,a],[a,b],[b,a],[b,b] if<br>
&gt;&gt; compare a b = EQ.<br>
<br>
</div>Nonsense. &nbsp;Consider a Schwartzian transform wrapper:<br>
<br>
data OrdWrap k v = OrdWrap k v<br>
<br>
instance (Ord k) =&gt; Ord (OrdWrap k v) where<br>
 &nbsp; &nbsp; compare (OrdWrap k1 v1) (OrdWrap k2 v2) = OrdWrap k1 k2<br>
<br>
It would be incorrect (and not sane) for sort [a,b] to return [a,a] in<br>
this case, though a case could be made that either [a,b] or [b,a] make<br>
sense.<br>
<div class="Ih2E3d"><br>
Quoting Jules Bean &lt;<a href="mailto:jules@jellybean.co.uk">jules@jellybean.co.uk</a>&gt;:<br>
<br>
&gt; Stability is a nice property. I don&#39;t understand why you are arguing<br>
&gt; against this so aggressiviely.<br>
<br>
</div>Stability is an occasionally very useful property. &nbsp;However, if there<br>
is a tradeoff between stability and performance, I&#39;d prefer it if the<br>
library didn&#39;t choose for me.<br>
<br>
Cheers,<br>
Andrew Bromage<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<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>