[Haskell-cafe] Haskell performance (again)!

ihope ihope127 at gmail.com
Sun Oct 8 17:06:27 EDT 2006

On 10/8/06, Yang <hehx0sk02 at sneakemail.com> wrote:
> And do most (experienced) Haskell
> users sacrifice cleanliness for speed, or speed for cleanliness?

Keep the internals of your code--that which will be looked at a
lot--fast and ugly, while the rest can be clean. If you have a
function that does something very simple, but the "pretty" way to do
it takes a second to run while the ugly way is much, much faster, use
the pretty one if it's only going to be needed once or twice. It's
certainly not the kind of thing you want to fold your lists with: use
the ugly version for that.

Also, if you want, you can write both a pretty version and an ugly
version, and put the pretty version in comments while the ugly version
does all the real work.

More information about the Haskell-Cafe mailing list