Hello,
while debugging encoding problems in darcs, I replaced the definition of
Printer.hPrintPrintable with the following code (which outputs pure
ASCII and explicitely shows non-ASCII character codes and such):
hPrintPrintable h (S str) = hPutStr h ("String:\n" ++ show str ++ "\n")
hPrintPrintable h (PS byteStr) = hPutStr h ("ByteString:\n" ++ show (B.unpack byteStr) ++ "\n")
hPrintPrintable h (Both str byteStr) = hPrintPrintable h (S str) >> hPrintPrintable h (PS byteStr)
I then ran darcs changes on a small repository. This revealed an
interesting phenomenon: Every “Printable” that hPrintPrintable was
called with seemed to consist of only a single character (sometimes
represented by S, sometimes by Both). So hPrintPrintable is obviously
called once per character, which doesn’t seem sensible.
Best wishes,
Wolfgang
|