RE: readFloat

2002-06-04 Thread Simon Peyton-Jones
' 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

Re: readFloat

2002-05-31 Thread Ch. A. Herrmann
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

Re: readFloat

2002-05-31 Thread Max Kirillov
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

RE: readFloat

2002-05-30 Thread Simon Peyton-Jones
| 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

Re: readFloat

2002-05-29 Thread Wolfgang Jeltsch
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

readFloat

2002-05-28 Thread Simon Peyton-Jones
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