RE: readFloat

2002-06-04 Thread Simon Peyton-Jones
| Especially converting rationals to a string and back should | always be the identity. It would be better to print rationals in the | form |numerator % denominator | | and read them in the same form. Oh yes, that is absolutely what Haskell does for Rationals. The 'read' and 'sho

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
So why one might need it? I've never used Rational, but, if asked, I would say that they are for exact representation of numbers (some symbolic calcs). On the other side, 'real' dotted numbers always represent some real values with finite accuracy. That's look like a bad idea to me to call Rationa

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, that would

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 reading rationals, because Rational > isn't i