' and 'show' for Rational uses the % notation. No
proposed change here.
The point is instead this: if you specifically want to read a Rational
from
a string like "3.24", which is perfectly reasonable (324 % 100),
then the same function (readFloat) should do it as read a Float
Hi Haskellers,
> "Max" == Max Kirillov <[EMAIL PROTECTED]> writes:
Max> So why one might need it? I've never used Rational, but, if
Max> asked, I would say that they are for exact representation of
Max> numbers (some symbolic calcs).
that's true. I'm using rationals intensively
d idea to me to call Rational
numbers 'real' and type (print) them as a decimal fraction (*).
Further, one would like to treat Rational as not just a
decimal fraction, but, for example, decimal fraction with a
period -- 0.12(3).
I think that (readFloat :: ReadS Rational) must not be in
Repor
| It would be strange to name a function readFloat if its type is
| RealFrac a => ReadS a.
| I think the function should be named readFrac. For
| compatibility, one could put the following into the prelude:
| readFloat :: RealFloat a => ReadS a
| readFloat = readFrac
Well
On Tuesday, 2002-05-28, 18:57, CEST Simon Peyton-Jones wrote:
> Folks
>
> I'm back to tidying up the Haskell Report.
>
> In the Numeric library, there is the useful function
>
> readFloat :: RealFloat a => ReadS a
>
> But you can't use it for rea
Folks
I'm back to tidying up the Haskell Report.
In the Numeric library, there is the useful function
readFloat :: RealFloat a => ReadS a
But you can't use it for reading rationals, because Rational
isn't in RealFloat!
This is a Royal Pain, and entirely un