Hi Stefan, this looks like great (and well explained) work!

To modify the behavior of existing libraries you need to tackle the change per 
library and upstream it by opening a ticket on the associated issue tracker and 
discussing with the developers/maintainers.

For `base` itself there is a standardized process to introduce changes to the 
behavior of the standard library. It’s called a Core Libraries Committee (CLC) 
Proposal[1].
Since you have already written up very precisely the problem, existing 
behavior, and proposed change, you should be able to copy it relatively 
verbatim to a ticket on the CLC to begin an official discussion.

That said, it is very good you have posted it to haskell-cafe and to ghc-devs, 
as that hopefully makes a wider audience interested in your proposal and gives 
them a chance to discuss it publicly before starting the formal process of a 
proposal.

Regarding the implementation for `base` specifically, you can indeed open a bug 
report to discuss with ghc and core libraries devs the issue and implementation 
— that said, the final decision regarding changes to `base` lies with the CLC 
and has to go through the proposal process. Typically these kinds of tickets 
also serve to track the upstream CLC proposal once it’s open.

Submitting a MR sounds like a good idea as well. You may find it interesting to 
get GHC compiling, your change applied, and see how CI responds to it :).
The place you pointed at in the `base` module looks about right.

By the way, if you find any trouble with compiling GHC or applying your change, 
do reach out and we can help you get it working. You can ping me (@alt-romes) 
on your Merge Request, or e.g. shoot an email here.

I don’t have a strong opinion regarding `read` for `Word8`, so I hope other 
devs may comment on the contents of your proposal more specifically.

Good luck!
Rodrigo Mesquita

[1]: https://github.com/haskell/core-libraries-committee

> On 20 Jul 2025, at 20:12, Stefan Klinger <hask...@stefan-klinger.de> wrote:
> 
> Hello,
> 
> I'd like to bring to your attention a discussion that I have started
> over at Haskell-cafe [1].  I was complaining about the silent overflow
> of parsers for bounded integers:
> 
>> read "298" :: Word8
>    42
> 
> I find this unsatisfying, and I have demonstrated a solution [2] that
> seems correct and performant.
> 
> To avoid cross posting, I'd rather point you to the discussion on the
> Haskell-cafe mailing list [1].
> 
> I would like to help get this into GHC and also other parsing
> libraries.  Not all libraries suffer from this issue, but some do,
> including GHC and its `base` package.
> 
> How can I attempt this?  Should I file a bug report?  Or try to follow
> the instructions at ghc.dev [3] and submit a pull request?  I would
> start tinkering at [this point][4] as soon as I manage to compile GHC.
> 
> Would you want to share any advice beforehand?  I'd really appreciate
> to be stopped before wasting effort ;-)  Also, I probably only can work
> on this on weekends.
> 
> Cheers
> Stefan
> 
> 
> [1]: https://mail.haskell.org/pipermail/haskell-cafe/2025-July/137134.html
> [2]: https://github.com/s5k6/robust-int
> [3]: https://ghc.dev/
> [4]: 
> https://hackage.haskell.org/package/ghc-internal-9.1201.0/docs/src/GHC.Internal.Read.html#line-586
> 
> 
> --
> Stefan Klinger, Ph.D. -- computer scientist              o/X
> http://stefan-klinger.de                                 /\/
> https://github.com/s5k6                                    \
> I prefer receiving plain text messages, not exceeding 32kB.
> _______________________________________________
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to