readFloat

Simon Peyton-Jones simonpj@microsoft.com
Tue, 28 May 2002 09:57:58 -0700


Folks

I'm back to tidying up the Haskell Report.

In the Numeric library, there is the useful function

	readFloat :: RealFloat a =3D> ReadS a

But you can't use it for reading rationals, because Rational
isn't in RealFloat!

This is a Royal Pain, and entirely unnecessary. In fact,
readFloat uses only operations from the RealFrac class,
so it could equally well have type

	readFloat :: RealFrac a =3D> ReadS a

I'm strongly inclined to make this change. It breaks no
programs, and it fixes a real bug i.e. there is no way to
read a "103" as a Rational.

Simon