|
|
|
|
|
by ColinWright
2323 days ago
|
|
Not being great at reading Haskell, I have some questions I was hoping people here could answer: * Does this cope with different whitespace, such as tabs? * Does this cope with different settings of locale? * Does this include the option of the "longest line"? * Does this perform the character counts? I'm pretty sure wc does all these, and that stripping them out would make it faster. If this Haskell version doesn't do that, and yet still compares against a fully-featured version of wc, the comparison hardly seems fair. |
|
* Looking at a single byte at a time, it presumably only handles the "C" locale :) They don't say what locale GNU wc was tested with (if it's not LANG=C, that benchmark should be re-run)
* --max-line-length? no. But I'm guessing GNU wc isn't benchmarked with that option on (can't find the invocation in the blog post though)
* data State { ws, bs, ls } keeps count of words, bytes (more honest than calling it characters) and lines.