dirty little kludge to make Rational literals work better.
dirty little kludge to make Rational literals work better.

In Haskell, floating point literals are applications of fromRational;
In Hugs, they're applications of fromDouble, a private method of Fractional.
This is fine for the common case where Double is intended, but leads to
embarassments like

	Prelude> 0.3::Rational
	5033165 % 16777216

The real solution would be to use Rationals, but that would be hard for
an interpreter to optimize.

This hack changes fromDouble to yield a decimal fraction, hopefully the
one the user gave in the first place, though some precision may be lost,
and it doesn't work near the bottom of the range.

FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs