1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
5 -- Copyright : (c) The University of Glasgow 2001
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : provisional
10 -- Portability : portable
12 -- The Prelude: a standard module imported by default into all Haskell
13 -- modules. For more documentation, see the Haskell 98 Report
14 -- <http://www.haskell.org/onlinereport/>.
16 -----------------------------------------------------------------------------
25 Char, String, Int, Integer, Float, Double, IO,
27 #if defined(__GLASGOW_HASKELL__) || defined(__NHC__)
28 -- Restore export of (:) until we get to 5.05
29 []((:), []), -- Not legal Haskell 98;
30 -- ... available through built-in syntax
31 module Data.Tuple, -- Includes tuple types
32 ()(..), -- Not legal Haskell 98
33 (->), -- ... available through built-in syntax
36 (:), -- Not legal Haskell 98
39 -- * Basic type classes
41 Ord(compare, (<), (<=), (>=), (>), max, min),
42 Enum(succ, pred, toEnum, fromEnum, enumFrom, enumFromThen,
43 enumFromTo, enumFromThenTo),
44 Bounded(minBound, maxBound),
46 -- * Numeric type classes
47 Num((+), (-), (*), negate, abs, signum, fromInteger),
49 Integral(quot, rem, div, mod, quotRem, divMod, toInteger),
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, atan2),
59 map, (++), filter, concat,
60 head, last, tail, init, null, length, (!!),
61 foldl, foldl1, scanl, scanl1, foldr, foldr1, scanr, scanr1,
62 iterate, repeat, replicate, cycle,
63 take, drop, splitAt, takeWhile, dropWhile, span, break,
65 any, all, elem, notElem, lookup,
66 maximum, minimum, concatMap,
67 zip, zip3, zipWith, zipWith3, unzip, unzip3,
69 lines, words, unlines, unwords,
72 -- * Converting to and from @String@
74 Read(readsPrec, readList),
75 Show(showsPrec, showList, show),
76 reads, shows, read, lex,
77 showChar, showString, readParen, showParen,
79 -- * Simple I\/O operations
80 ioError, userError, catch,
83 putStr, putStrLn, print,
85 getLine, getContents, interact,
86 readFile, writeFile, appendFile, readIO, readLn,
89 Monad((>>=), (>>), return, fail),
91 mapM, mapM_, sequence, sequence_, (=<<),
93 -- * Miscellaneous functions
95 (&&), (||), not, otherwise,
96 subtract, even, odd, gcd, lcm, (^), (^^),
97 fromIntegral, realToFrac,
98 fst, snd, curry, uncurry,
99 id, const, (.), flip, ($), until,
100 asTypeOf, error, undefined,
117 #ifdef __GLASGOW_HASKELL__
128 import GHC.Err ( error, undefined )
139 -- -----------------------------------------------------------------------------
140 -- Miscellaneous functions
142 ($!) :: (a -> b) -> a -> b