> Not necessarily. For example the 'nub' 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. <br><br>Why not in that kind of cases provide a second function (named differently), together with the original function, and specify they'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"><<a href="mailto:es@ertes.de" target="_blank">es@ertes.de</a>></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 <<a href="mailto:rrnewton@gmail.com">rrnewton@gmail.com</a>> wrote:<br>
<br>
> I do think we have the opposite problem, however, in much Haskell code<br>
> -- people are using the clean, obviously correct, but inefficient code<br>
> even in standard library functions that really should be optimized<br>
> like crazy!<br>
<br>
</div>Not necessarily. For example the 'nub' 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'm grateful.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Greets,<br>
Ertugrul<br>
<br>
--<br>
Key-ID: E5DD8D11 "Ertugrul Soeylemez <<a href="mailto:es@ertes.de">es@ertes.de</a>>"<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>