another minor fault in the Haskell Report

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 17 Jul 2002 17:38:38 +0100


I have just discovered another minor fault in the revised Haskell'98 Report.

In the definition of the Standard Prelude, (page 115)

    instance Read Float where
        readsPrec p = readFloat
    instance Read Double where
        readsPrec p = readFloat

are incorrect because they do not deal with a leading minus sign.
The correct versions are:

    instance Read Float where
        readsPrec p = readSigned readFloat
    instance Read Double where
        readsPrec p = readSigned readFloat

Funnily enough, all the implementations seem to have this fix already,
it is just the Report that gets it wrong!

Regards,
    Malcolm