[project @ 1999-02-01 10:02:15 by sof]
[ghc-hetmet.git] / ghc / lib / std / Prelude.lhs
1 We add the option -fno-implicit-prelude here to tell the reader that
2 special names such as () and -> shouldn't be resolved to Prelude.()
3 and Prelude.-> (as they are normally). -- SDM 8/10/97
4
5 \begin{code}
6 {-# OPTIONS -fno-implicit-prelude #-}
7
8 module Prelude (
9
10         -- Everything from these modules
11     module PrelList,
12
13         -- Everything corresponding to the Report's PreludeText
14     ReadS, ShowS,
15     Read(readsPrec, readList),
16     Show(showsPrec, showList, show),
17     reads, shows, read, lex, 
18     showChar, showString, readParen, showParen,
19     
20         -- Everything corresponding to the Report's PreludeIO
21     FilePath, IOError,
22     ioError, userError, catch,
23     putChar, putStr, putStrLn, print,
24     getChar, getLine, getContents, interact,
25     readFile, writeFile, appendFile, readIO, readLn,
26
27     Bool(..),
28     Maybe(..),
29     Either(..),
30     Ordering(..), 
31     Char, String, Int, Integer, Float, Double, IO,
32     Rational,
33     []((:), []),
34     
35     module PrelTup,
36         -- Includes tuple types + fst, snd, curry, uncurry
37     ()(..),             -- The unit type
38     (->),               -- functions
39     
40     Eq(..),
41     Ord(..), 
42     Enum(..),
43     Bounded(..), 
44     Num((+), (-), (*), negate, abs, signum, fromInteger, fromInt{-glaExt-}),
45     Real(..),
46     Integral(quot, rem, div, mod, quotRem, divMod, toInteger, toInt{-partain-}),
47     Fractional(..),
48     Floating(..),
49     RealFrac(..),
50     RealFloat(..),
51
52         -- From Monad
53     Monad(..),
54     Functor(..), 
55     mapM, mapM_, sequence, sequence_, (=<<),
56
57     maybe, either,
58     (&&), (||), not, otherwise,
59     subtract, even, odd, gcd, lcm, (^), (^^), 
60     fromIntegral, realToFrac,
61     --exported by PrelTup: fst, snd, curry, uncurry,
62     id, const, (.), flip, ($), until,
63     asTypeOf, error, undefined,
64     seq, ($!)
65
66   ) where
67
68 import PrelBase
69 import PrelList hiding ( takeUInt )
70 import PrelRead
71 import PrelNum
72 import PrelNumExtra
73 import PrelTup
74 import PrelMaybe
75 import PrelEither
76 import PrelBounded
77 import PrelConc
78 import Monad
79 import Maybe
80 import PrelErr   ( error )
81 import IO
82
83 infixr 0 $!
84
85 ($!)    :: (a -> b) -> a -> b
86 f $! x  = x `seq` f x
87
88 -- It is expected that compilers will recognize this and insert error
89 -- messages which are more appropriate to the context in which undefined 
90 -- appears. 
91
92 undefined               :: a
93 undefined               =  error "Prelude.undefined"
94 \end{code}
95
96
97