In the case of 0.1::Rational, it shouldn't be using floating point. The Report says this means fromRational (1%10), i.e. 1%10.
Aha. Now I have a little chance to die less naïve. All my conversion proposals are simply out of place, since there should be nothing to convert. And I understand the reluctance of Jón to accept the numerical types as belonging to the language...
... and I begin once again to appreciate the Scheme idea of having the distinction between exact and inexact numbers.
Of course, you are right reminding that when floats are engaged there is fuzziness in the conversion:
> (e.g.: which approximant in the series should be chosen?)
but I believe (still naïvely??) that those socio-psycho-pragmatisms which played some role in the definition of the language should be better tuned. If I were to write
pi = 3.1415926536 :: Rational
I suppose that I would like to see rather 355/113 or something close, than 3926990817/1250000000 or similar. GHCI doesn't make me happier than Hugs: 221069929751607/70368744177664. Thus, perhaps one day we might think about parametrizing the 'conversion' of *explicit* decimal numbers, and -- as some other language permit -- make it possible and practical to use any other base different from 10. What do you think?
Such parametrization (perhaps with some global default) would also help the user who permits himself to write x = 1.875987 :: Rational to assess the error introduced by the representation conversion.
Jerzy Karczmarczuk
_______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe