Cale Gibbard wrote:
This change means that Rational is no longer a field. It makes me feel
uneasy at least. Should we really expect realToFrac to propagate those
values? Look at its type:
realToFrac     :: (Real a, Fractional b) => a -> b
Nothing about the Fractional class would seem to indicate that NaN and
+-Infinity should be representable. In fact, it just looks like the
basic field operations, and fields don't tend to have such elements
(not that we require the field axioms to hold for every instance).

I know for a fact that the Ratio type excludes 1%0 and 0%0 from the
allowed values by design rather than by mistake.  I discussed it with
Joe Fasel many years ago, and he convinced me it was a bad idea.

But I admit that the realToFrac argument carries some weight, even
if I had never even thought about the problem before.

        -- Lennart


_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to