Skip to content

readInt docs mention Integral typeclass which doesn't appear in signature

Summary

The docs for readInt in Numeric mention Integral in single quotes, which makes it get linked to the Integral type class on rendering.

https://gitlab.haskell.org/ghc/ghc/-/blob/master/libraries/base/Numeric.hs#L81

Proposed improvements or changes

It should mention the Num constraint and whether the unsigned requirement is only relevant for input.

It seems to work fine for negative numbers:

ghci> readInt 2 (`elem` "01") digitToInt ("1" ++ (concat $ replicate 63 "1")) :: [(Int,String)]
[(-1,"")]

Environment

9.2.1

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information