[Haskell-cafe] Can Haskell outperform C++?

Ertugrul Söylemez es at ertes.de
Mon May 21 16:43:57 CEST 2012

Ryan Newton <rrnewton at gmail.com> wrote:

> I do think we have the opposite problem, however, in much Haskell code
> -- people are using the clean, obviously correct, but inefficient code
> even in standard library functions that really should be optimized
> like crazy!

Not necessarily.  For example the 'nub' function from Data.List could be
much faster.  Unfortunately this would also change its type.  O(n²)
complexity is really the best you can get with the Eq constraint.  You
have to change to Ord for better performance.

In other words:  Some optimizations change the semantics, and semantics
is taken very seriously in Haskell, for which I'm grateful.


Key-ID: E5DD8D11 "Ertugrul Soeylemez <es at ertes.de>"
FPrint: BD28 3E3F BE63 BADD 4157  9134 D56A 37FA E5DD 8D11
Keysrv: hkp://subkeys.pgp.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120521/fbac1952/attachment.pgp>

More information about the Haskell-Cafe mailing list