[project @ 2001-03-27 14:05:09 by simonpj]
[ghc-hetmet.git] / ghc / lib / std / Prelude.lhs
index 58de274..116c466 100644 (file)
@@ -1,3 +1,11 @@
+% ------------------------------------------------------------------------------
+% $Id: Prelude.lhs,v 1.25 2001/02/28 00:01:03 qrczak Exp $
+%
+% (c) The University of Glasgow, 1992-2000
+%
+
+\section[Prelude]{Module @Prelude@}
+
 We add the option -fno-implicit-prelude here to tell the reader that
 special names such as () and -> shouldn't be resolved to Prelude.()
 and Prelude.-> (as they are normally). -- SDM 8/10/97
@@ -43,11 +51,9 @@ module Prelude (
     Ord(..), 
     Enum(..),
     Bounded(..), 
-    Num((+), (-), (*), negate, abs, signum, fromInteger),
-       -- The fromInt method is exposed only by GlaExts
+    Num(..),
     Real(..),
-    Integral(quot, rem, div, mod, quotRem, divMod, toInteger),
-       -- The toInt method is exposed only by GlaExts
+    Integral(..),
     Fractional(..),
     Floating(..),
     RealFrac(..),
@@ -173,51 +179,3 @@ mapM_           :: Monad m => (a -> m b) -> [a] -> m ()
 {-# INLINE mapM_ #-}
 mapM_ f as      =  sequence_ (map f as)
 \end{code}
-
-
-%*********************************************************
-%*                                                     *
-\subsection{Coercions}
-%*                                                     *
-%*********************************************************
-
-\begin{code}
-{-# SPECIALIZE fromIntegral ::
-    Int                -> Rational,
-    Integer    -> Rational,
-    Int        -> Int,
-    Int        -> Integer,
-    Int                -> Float,
-    Int                -> Double,
-    Integer    -> Int,
-    Integer    -> Integer,
-    Integer    -> Float,
-    Integer    -> Double #-}
-fromIntegral   :: (Integral a, Num b) => a -> b
-fromIntegral   =  fromInteger . toInteger
-
-{-# SPECIALIZE realToFrac ::
-    Double     -> Rational, 
-    Rational   -> Double,
-    Float      -> Rational,
-    Rational   -> Float
- #-}
-realToFrac     :: (Real a, Fractional b) => a -> b
-realToFrac     =  fromRational . toRational
-
-{-# RULES
-"realToFrac/Double->Float"      realToFrac = doubleToFloat
-"realToFrac/Float->Double"      realToFrac = floatToDouble
-"realToFrac/Double->Double"     realToFrac = id :: Double -> Double
-"realToFrac/Float->Float"       realToFrac = id :: Float -> Float
-"realToFrac/Rational->Rational" realToFrac = id :: Rational -> Rational
- #-}
-
-doubleToFloat :: Double -> Float
-doubleToFloat (D# d) = F# (double2Float# d)
-
-floatToDouble :: Float -> Double
-floatToDouble (F# f) = D# (float2Double# f)
-
-\end{code}
-