Double -> CDouble, realToFrac doesn't work
ross at soi.city.ac.uk
Fri Nov 5 07:18:59 EST 2004
On Fri, Nov 05, 2004 at 10:53:36AM +0100, Marcin 'Qrczak' Kowalczyk wrote:
> ross at soi.city.ac.uk writes:
> > [The proposal is to add 0:%0, 1:%0 and -1:%0 to Rational.]
> > Changing Rational from meaning rational numbers would also be bad. I'd
> > prefer to redefine realToFrac to go through a new type that is the union
> > of Rational and these values.
> It's not enough if you care about preserving -0.0.
True, and denormalized values (whatever they are).
> Instead of materializing variants, the function could check isInfinite
> etc. - except that these functions are in RealFloat class, not available
> for arbitrary Real numbers.
But isn't that fatal? We're stuck with the type
realToFrac :: (Real a, Fractional b) => a -> b
All we can change is its specification.
More information about the Libraries