[Haskell-cafe] Re: (flawed?) benchmark : sort

Ketil Malde ketil at malde.org
Mon Mar 10 10:40:23 EDT 2008


Adrian Hey <ahey at iee.org> writes:

> But seriously, once you admit the possibility that even if x == y it
> still matters which of x or y is used in expressions than all hell
> breaks loose. I shudder to think just how much Haskell code there must
> be out there that is (at best) ambiguious or just plain "broken" if
> this is a serious possibility.

Just search for "copy" (on ByteStrings).

One program of mine was extracting substrings from a large
file.  Since the file was pretty huge, I used lazy bytestrings for this
purpose.  Unfortunately, the short substrings I retained pulled with them
rather large chunks from the file -- since a bytestring is essentially
a pointer to a chunk, an offset, and a length.  The solution is
"copy", which creates a new string, indistinguishable from within
Haskell, but with very different effects on the program.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list