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