0167b0cef9798b1231070e97aa19ad8e61de9690
[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 Maybe
35     maybe,
36
37         -- From PrelRead
38     ReadS, Read(readsPrec, readList),
39     reads, read, lex, readParen, 
40
41         -- From PrelShow
42
43         -- From PrelNum
44     Ratio, Rational, 
45     (%), numerator, denominator, approxRational,
46
47     Num((+), (-), (*), negate, abs, signum, fromInteger),
48     Real(toRational),
49     Integral(quot, rem, div, mod, quotRem, divMod, toInteger, toInt{-partain-}),
50     Fractional((/), recip, fromRational),
51     Floating(pi, exp, log, sqrt, (**), logBase, sin, cos, tan,
52              asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh),
53     RealFrac(properFraction, truncate, round, ceiling, floor),
54     RealFloat(floatRadix, floatDigits, floatRange, decodeFloat,
55               encodeFloat, exponent, significand, scaleFloat, isNaN,
56               isInfinite, isDenormalized, isIEEE, isNegativeZero),
57     subtract, even, odd, gcd, lcm, (^), (^^), 
58     fromIntegral, fromRealFrac, atan2
59   ) where
60
61 import PrelBase
62 import PrelList
63 import PrelIO
64 import PrelRead
65 import PrelNum
66 import PrelTup
67 import Monad
68 import Maybe
69 import IOBase   ( error )
70
71 -- These can't conveniently be defined in PrelBase because they use numbers,
72 -- or I/O, so here's a convenient place to do them.
73
74 strict      :: Eval a => (a -> b) -> a -> b
75 strict f x  = x `seq` f x
76
77 {-# INLINE seq  #-}
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