Proposal: modify `Read` instances for `Float` and `Double`

Iavor Diatchki iavor.diatchki at gmail.com
Tue Feb 28 19:07:28 UTC 2017


Hello,

I am working on a small GHC extension to support floating point literals in
hexadecimal notation (https://github.com/ghc-proposals/ghc-proposals/pull/37),
which is similar to what's available in other languages.

To support this change, I would like to propose that we modify the `Read`
instances for `Float` and `Double` to parse literals in the new notation.

This may affect existing programs---although it doesn't seem very likely.
Here is an example:

current behavior:

reads "0x10p10" = [(16.0,"p10")]

new behavior:

reads "0x10p10" = [(16384,"")]


What do people think?

-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170228/35d95a7d/attachment.html>


More information about the Libraries mailing list