
I think I've come across a bug in the (==) function of PackedString, but it's hard to reproduce. I'm attaching a set of files that hopefully will reproduce the problem. My assumption is that if two packed strings are unequal, then when their unpacked versions must also be equal. This is, of course, assuming one starts with the packed versions, since packing of strings may be lossy... Anyhow, the guts of the problem is in the following (where c1 and c2 are packed strings): if c1 == c2 then return True else do putStr $ "First version:\n" putStr $ unpackPS c1 ++ "\n" putStr $ "second version:\n" putStr $ unpackPS c2 ++ "\n" if unpackPS c1 == unpackPS c2 then putStr "But unpacked, they are the same!!!\n" else putStr "And unpacked they are different!\n" return False I think that it is a bug if the line "But unpacked, they are the same!!!" ever gets printed (which it does--but it's hard to reproduce). This bug is rather troubling to me, since one of the reasons I'm using packed strings is for the assumed efficiency of comparison, the other being of course storage space, which would be sufficient in itself to mandate packed strings. Anyhow, I'm attaching a test program with a test file (which needs to be named both test1 and test2) which is able to reproduce an error in the above. Sorry I haven't made it any simpler. -- David Roundy http://www.abridgegame.org