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