
13 Jul
2025
13 Jul
'25
12:06 p.m.
On 13/07/2025 13:34, Stefan Klinger wrote:
Unfortunately, I got a bit lost when trying to track down the code of `read` in the `base` package.
Fortunately, this at least is easily answerable. Going here for the Read class [1], scrolling down to the Read Int instance and clicking 'Source' leads one here [2]; subsequently clicking through to the definitions of readNumber and convertInt should lead you to the actual parsing code. It is implemented in terms of a ReadP parser. - Tom [1]: https://hackage.haskell.org/package/base-4.21.0.0/docs/GHC-Read.html#t:Read [2]: https://hackage.haskell.org/package/ghc-internal-9.1201.0/docs/src/GHC.Inter...