realToFrac vs. fromRealFrac

Simon Peyton-Jones simonpj@microsoft.com
Mon, 5 Feb 2001 05:56:21 -0800


This is already noted as a typo in the typos draft:

	http://research.microsoft.com/~simonpj/haskell/haskell98-bugs.html

Simon

| -----Original Message-----
| From: Manuel M. T. Chakravarty [mailto:chak@cse.unsw.edu.au]
| Sent: 03 February 2001 12:35
| To: haskell@haskell.org
| Subject: realToFrac vs. fromRealFrac
| 
| 
| 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
| 
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|