Read instances for integral numbers are broken (because they use `fromIntegral`)
Steps to reproduce
In GHCI:
ghci> import Data.Word
ghci> import Data.Int
ghci> read "300" :: Int8
44
ghci> read "300" :: Word8
44
ghci> read "300000" :: Int16
-27680
ghci> read "300000" :: Word16
37856
ghci> read "10000000000000" :: Int32
1316134912
ghci> read "10000000000000" :: Word32
1316134912
ghci> read "5000000000000000000000" :: Int
932356024711512064
ghci> read "5000000000000000000000" :: Word
932356024711512064
ghci> read "5000000000000000000000" :: Int64
932356024711512064
ghci> read "5000000000000000000000" :: Word64
932356024711512064
ghci> read "-1" :: Word8
255
ghci> read "-1" :: Word16
65535
ghci> read "-1" :: Word32
4294967295
ghci> read "-1" :: Word
18446744073709551615
Expected behavior
Fail to parse.
Environment
- GHC version used:
GHCi, version 9.2.8