realToFrac vs. fromRealFrac

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Sat, 03 Feb 2001 23:34:37 +1100


I am not sure whether the following issue has already been
mentioned earlier.

Chapter 6 ``Predefined Types and Classes'' of The Report
says at its very end,

  Also available are the following coercion functions: 

  fromIntegral :: (Integral a, Num b) => a -> b
  fromRealFrac :: (RealFrac a, Fractional b) => a -> b

(`fromRealFrac' is also defined in Figure 7.)

However, in Appendix A ``Standard Prelude'', we have

  realToFrac     :: (Real a, Fractional b) => a -> b
  realToFrac      = fromRational . toRational

instead of a definition for `fromRealFrac'.

Both GHC and Hugs go by Appendix A.  What was the original
intention?

Cheers,
Manuel