[project @ 2001-08-04 06:11:24 by ken]
[ghc-hetmet.git] / ghc / lib / std / Prelude.lhs
index cf2fb00..ebe7b82 100644 (file)
@@ -1,3 +1,11 @@
+% ------------------------------------------------------------------------------
+% $Id: Prelude.lhs,v 1.26 2001/05/18 16:54:05 simonmar 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
@@ -20,10 +28,12 @@ module Prelude (
     showChar, showString, readParen, showParen,
     
         -- Everything corresponding to the Report's PreludeIO
-    FilePath, IOError,
     ioError, userError, catch,
-    putChar, putStr, putStrLn, print,
-    getChar, getLine, getContents, interact,
+    FilePath, IOError,
+    putChar,
+    putStr, putStrLn, print,
+    getChar,
+    getLine, getContents, interact,
     readFile, writeFile, appendFile, readIO, readLn,
 
     Bool(..),
@@ -43,15 +53,15 @@ module Prelude (
     Ord(..), 
     Enum(..),
     Bounded(..), 
-    Num((+), (-), (*), negate, abs, signum, fromInteger, fromInt{-glaExt-}),
+    Num(..),
     Real(..),
-    Integral(quot, rem, div, mod, quotRem, divMod, toInteger, toInt{-partain-}),
+    Integral(..),
     Fractional(..),
     Floating(..),
     RealFrac(..),
     RealFloat(..),
 
-       -- From Monad
+       -- Monad stuff, from PrelBase, and defined here
     Monad(..),
     Functor(..), 
     mapM, mapM_, sequence, sequence_, (=<<),
@@ -67,35 +77,49 @@ module Prelude (
 
   ) where
 
+import Monad
+
 import PrelBase
-import PrelList hiding ( takeUInt_append )
+import PrelList
+#ifndef USE_REPORT_PRELUDE
+     hiding ( takeUInt_append )
+#endif
+import PrelIO
+import PrelIOBase
+import PrelException
 import PrelRead
 import PrelEnum
 import PrelNum
-import PrelNumExtra
+import PrelReal
+import PrelFloat
 import PrelTup
 import PrelMaybe
 import PrelShow
 import PrelConc
-import Monad
-import Maybe
-import PrelErr   ( error )
-import IO
+import PrelErr   ( error, undefined )
 
 infixr 0 $!
+\end{code}
 
-($!)    :: (a -> b) -> a -> b
-f $! x  = x `seq` f x
 
--- It is expected that compilers will recognize this and insert error
--- messages which are more appropriate to the context in which undefined 
--- appears. 
+%*********************************************************
+%*                                                     *
+\subsection{Miscellaneous functions}
+%*                                                     *
+%*********************************************************
 
-undefined               :: a
-undefined               =  error "Prelude.undefined"
+\begin{code}
+($!)    :: (a -> b) -> a -> b
+f $! x  = x `seq` f x
 \end{code}
 
 
+%*********************************************************
+%*                                                     *
+\subsection{List sum and product}
+%*                                                     *
+%*********************************************************
+
 List sum and product are defined here because PrelList is too far
 down the compilation chain to "see" the Num class.
 
@@ -120,3 +144,4 @@ product     l       = prod l 1
     prod (x:xs) a = prod xs (a*x)
 #endif
 \end{code}
+