X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Prelude.hs;h=9f044e57456163d5e4006bbed16e7b10288bf3ec;hb=56c900f7554904e4eef467b03635e732360aefc9;hp=8d76a0458e09a40c149acffff5e30a2f133bae97;hpb=cdca1cd8e3b95c7725258b73a369a53041b8a9c2;p=ghc-base.git diff --git a/Prelude.hs b/Prelude.hs index 8d76a04..9f044e5 100644 --- a/Prelude.hs +++ b/Prelude.hs @@ -18,14 +18,16 @@ module Prelude ( -- * Basic data types - Bool(..), - Maybe(..), - Either(..), - Ordering(..), + Bool(False, True), + Maybe(Nothing, Just), + Either(Left, Right), + Ordering(LT, EQ, GT), Char, String, Int, Integer, Float, Double, IO, Rational, +#ifdef __GLASGOW_HASKELL__ -- Restore export of (:) until we get to 5.05 []((:), []), -- Not legal Haskell 98; available through built-in syntax +#endif module Data.Tuple, -- Includes tuple types + fst, snd, curry, uncurry @@ -33,17 +35,23 @@ module Prelude ( -- (->), -- ... available through built-in syntax -- * Basic type classes - Eq(..), - Ord(..), - Enum(..), - Bounded(..), - Num(..), - Real(..), - Integral(..), - Fractional(..), - Floating(..), - RealFrac(..), - RealFloat(..), + Eq((==), (/=)), + Ord(compare, (<), (<=), (>=), (>), max, min), + Enum(succ, pred, toEnum, fromEnum, enumFrom, enumFromThen, + enumFromTo, enumFromThenTo), + Bounded(minBound, maxBound), + + -- * Numeric type classes + Num((+), (-), (*), negate, abs, signum, fromInteger), + Real(toRational), + Integral(quot, rem, div, mod, quotRem, divMod, toInteger), + Fractional((/), recip, fromRational), + Floating(pi, exp, log, sqrt, (**), logBase, sin, cos, tan, + asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh), + RealFrac(properFraction, truncate, round, ceiling, floor), + RealFloat(floatRadix, floatDigits, floatRange, decodeFloat, + encodeFloat, exponent, significand, scaleFloat, isNaN, + isInfinite, isDenormalized, isIEEE, isNegativeZero, atan2), -- * List operations map, (++), filter, concat, @@ -76,8 +84,8 @@ module Prelude ( readFile, writeFile, appendFile, readIO, readLn, -- * Monads - Monad(..), - Functor(..), + Monad((>>=), (>>), return, fail), + Functor(fmap), mapM, mapM_, sequence, sequence_, (=<<), -- * Miscellaneous functions