054e3e324700164fcdf046171c743b4d6a8e258d
[ghc-hetmet.git] / ghc / lib / required / Prelude.lhs
1
2 \begin{code}
3 module Prelude (
4
5         -- Everything from these modules
6     module PrelList,
7     module PrelIO,
8     module PrelTup,
9
10         -- From PrelBase
11     (->),
12     Eq(..), 
13     Ord(..), Ordering(..), 
14     Bounded(..), 
15     Enum(..), succ, pred, 
16     Show(..), ShowS, shows, show, showChar, showString, showParen,
17     Num(..), 
18     Eval(..), seq, strict,
19     Bool(..), (&&), (||), not, otherwise,
20     Char, String, Int, Integer, Float, Double, Void,
21     Maybe(..), maybe,
22     Either(..), either,
23     ()(..),             -- The unit type
24
25     
26     id, const, (.), flip, ($), until, asTypeOf, undefined,
27
28         -- From IOBase
29     error,
30
31         -- From Monad
32     Functor(..), Monad(..), MonadZero(..), MonadPlus(..),
33     accumulate, sequence, mapM, mapM_, guard, filter, concat, applyM,
34
35         -- From PrelRead
36     ReadS, Read(readsPrec, readList),
37     reads, read, lex, readParen, 
38
39         -- From PrelShow
40
41         -- From PrelNum
42     Ratio, Rational, 
43     (%), numerator, denominator, approxRational,
44
45     Num((+), (-), (*), negate, abs, signum, fromInteger),
46     Real(toRational),
47     Integral(quot, rem, div, mod, quotRem, divMod, toInteger, toInt{-partain-}),
48     Fractional((/), recip, fromRational),
49     Floating(pi, exp, log, sqrt, (**), logBase, sin, cos, tan,
50              asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh),
51     RealFrac(properFraction, truncate, round, ceiling, floor),
52     RealFloat(floatRadix, floatDigits, floatRange, decodeFloat,
53               encodeFloat, exponent, significand, scaleFloat, isNaN,
54               isInfinite, isDenormalized, isIEEE, isNegativeZero),
55     subtract, even, odd, gcd, lcm, (^), (^^), 
56     fromIntegral, fromRealFrac, atan2
57   ) where
58
59 import PrelBase
60 import PrelList
61 import PrelIO
62 import PrelRead
63 import PrelNum
64 import PrelTup
65 import Monad
66 import Maybe
67 import IOBase   ( error )
68 import GHCerr
69
70 -- These can't conveniently be defined in PrelBase because they use numbers,
71 -- or I/O, so here's a convenient place to do them.
72
73 strict      :: Eval a => (a -> b) -> a -> b
74 strict f x  = x `seq` f x
75
76 {-# INLINE seq  #-}
77 seq :: Eval a => a -> b -> b
78 #ifdef __CONCURRENT_HASKELL__
79 seq  x y = case (seq#  x) of { 0# -> parError; _ -> y }
80 #else
81 seq  x y = y            -- WRONG!
82 #endif
83
84 -- It is expected that compilers will recognize this and insert error
85 -- messages which are more appropriate to the context in which undefined 
86 -- appears. 
87
88 undefined               :: a
89 undefined               =  error "Prelude.undefined"
90 \end{code}
91
92
93