
8 Oct
2006
8 Oct
'06
9:06 p.m.
On 10/8/06, Yang
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.