+% ------------------------------------------------------------------------------
+% $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
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(..),
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(..),
RealFloat(..),
- -- From Monad
+ -- Monad stuff, from PrelBase, and defined here
Monad(..),
Functor(..),
mapM, mapM_, sequence, sequence_, (=<<),
) where
+import Monad
+
import PrelBase
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.
prod (x:xs) a = prod xs (a*x)
#endif
\end{code}
+