&gt; Not necessarily.  For example the &#39;nub&#39; function from Data.List could be<br>
&gt; much faster.  Unfortunately this would also change its type.  O(n²)<br>
&gt; complexity is really the best you can get with the Eq constraint. <br><br>Why not in that kind of cases provide a second function (named differently), together with the original function, and specify they&#39;re differences (i.e. wrt performances) in the doc?<br>

It seems like a pretty quick and honest trade-off to me.<br><br><div class="gmail_quote">2012/5/21 Ertugrul Söylemez <span dir="ltr">&lt;<a href="mailto:es@ertes.de" target="_blank">es@ertes.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">Ryan Newton &lt;<a href="mailto:rrnewton@gmail.com">rrnewton@gmail.com</a>&gt; wrote:<br>
<br>
&gt; I do think we have the opposite problem, however, in much Haskell code<br>
&gt; -- people are using the clean, obviously correct, but inefficient code<br>
&gt; even in standard library functions that really should be optimized<br>
&gt; like crazy!<br>
<br>
</div>Not necessarily.  For example the &#39;nub&#39; function from Data.List could be<br>
much faster.  Unfortunately this would also change its type.  O(n²)<br>
complexity is really the best you can get with the Eq constraint.  You<br>
have to change to Ord for better performance.<br>
<br>
In other words:  Some optimizations change the semantics, and semantics<br>
is taken very seriously in Haskell, for which I&#39;m grateful.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Greets,<br>
Ertugrul<br>
<br>
--<br>
Key-ID: E5DD8D11 &quot;Ertugrul Soeylemez &lt;<a href="mailto:es@ertes.de">es@ertes.de</a>&gt;&quot;<br>
FPrint: BD28 3E3F BE63 BADD 4157  9134 D56A 37FA E5DD 8D11<br>
Keysrv: hkp://<a href="http://subkeys.pgp.net/" target="_blank">subkeys.pgp.net/</a><br>
</div></div><br>_______________________________________________<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>
<br></blockquote></div><br>