[Haskell-cafe] reading and writing Data.Ratio.Rational

ALeX Kazik alex at kazik.de
Fri Feb 24 12:36:31 UTC 2017


Hi,

> So here's my question. A literal like 0.7 has type Fractional a => a, but the Read instance of Rational rejects the string "0.7". Must it be this way? Do I have to go via toRational.(read :: String -> Data.Scientific.Scientific)?

You can only parse "7%10".

ALeX.


More information about the Haskell-Cafe mailing list