[Haskell-cafe] Proposal: Rational read

Sean Leather sean.leather at gmail.com
Sun Aug 14 20:00:34 UTC 2016

Hi Tom,

On Sun, Aug 14, 2016 at 9:48 PM, Tom wrote:

> Is there a reason to not allow '.' as a separator for Rational's Read
> instance, so that both "1%2" and "0.5" can be read?

While it would make read :: String -> Rational more convenient, I'm not
sure it would be a good idea to have read accept input that will never be
produced by show :: Rational -> String.

As an alternative, you can use readFloat [1] in Numeric.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160814/c75acbcf/attachment.html>

More information about the Haskell-Cafe mailing list