Optimising words

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Jul 9 18:43:09 EDT 2007


On Mon, 2007-07-09 at 16:10 +0100, Neil Mitchell wrote:
> Hi
> 
> While benchmarking a word count program I found that it wasn't running
> as fast as it could. I traced this back to the original definition of
> words, which isn't as good as it could be:

[...]

> Is my reasoning correct? If so, can we make this optimisation?

To really convince yourself and everyone else you could compare it
against the spec, for both total and partial values. For our list
library re-implementation we used SmallCheck and a modified version of
SmallCheck for checking partial values. It turned up lots of bugs in our
code and found several instances where the current base implementations
are not the same as the spec (for various good reasons).

http://www.cse.unsw.edu.au/~dons/code/streams/list/tests/Strictness/BaseVsSpec.hs

Duncan



More information about the Libraries mailing list