[Haskell-cafe] Proposal: Rational read

Doug McIlroy doug at cs.dartmouth.edu
Tue Aug 16 14:16:32 UTC 2016


It has been suggested that (read "0.5" :: Rational) need not work
because (show (0.5::Rational)) will never yield the string "0.5".

In contrast, (read "1" :: Double) does work, even though
(show (1::Double)) will never yield the string "1".

The inconsistency is stark.

Doug


More information about the Haskell-Cafe mailing list