[Yhc] Bug report, bad Data.Char module

Neil Mitchell ndmitchell at gmail.com
Mon Sep 25 20:39:09 EDT 2006


Hi,

A few bugs in one here, if you take a look at Data.Char, protectEsc,
you'll find the definition

protectEsc p f         = f . cont
                 where cont s@(c:_) | p c = "\\&" ++ s
                   cont s         = s

Note the second equation of cont is not in a group with the first!
This function gives an error on the empty list, despite what you might
think!

So bug 1 is that we have bad libraries. Bug 2 is that the compiler
doesn't beep there when it should, I guess this is shared nhc code.

Interestingly, Catch was able to spot this bug pretty easily, as soon
as it got a program that tickled those bits of the library.

Thanks

Neil


More information about the Yhc mailing list