x = 123456 is equivalent to x = fromInteger (read "123456" :: Integer)
It's basically what happens internally. You can see the convertInt function and it's used a few lines beneath in the Read Int instance.
convertInt :: Num a => L.Lexeme -> ReadPrec a convertInt (L.Number n) | Just i <- L.numberToInteger n = return (fromInteger i)
Well, IIUC, it conforms to the Haskell 98 specification. In that sense, it's not buggy. But the specification may be sound and counter-intuitive (which is not an uncommon combination…).But there is a *different* read function read :: String -> Word8 which is not used in the scenario above, and this is the buggy one (and all its bounded cousins).
Curiously,
Pierre Thierry
--
pierre@nothos.net 0xD9D50D8A