X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=Prelude.hs;h=61bd27eb8bd1121a21f16b3a5982b324bda59125;hb=00028fd62f34b69a727c35aa880d2d54b89a00e8;hp=cccfcb574f0ef80850c1828623eca25e0bcf0146;hpb=a87bf77d4a5dfaae56867a96749f204aee0192de;p=ghc-base.git diff --git a/Prelude.hs b/Prelude.hs index cccfcb5..61bd27e 100644 --- a/Prelude.hs +++ b/Prelude.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -XNoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Prelude @@ -6,7 +6,7 @@ -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org --- Stability : provisional +-- Stability : stable -- Portability : portable -- -- The Prelude: a standard module imported by default into all Haskell @@ -36,16 +36,16 @@ module Prelude ( fst, snd, curry, uncurry, #if defined(__NHC__) - []((:), []), -- Not legal Haskell 98; - -- ... available through built-in syntax - module Data.Tuple, -- Includes tuple types - ()(..), -- Not legal Haskell 98 - (->), -- ... available through built-in syntax + []((:), []), -- Not legal Haskell 98; + -- ... available through built-in syntax + module Data.Tuple, -- Includes tuple types + ()(..), -- Not legal Haskell 98 + (->), -- ... available through built-in syntax #endif #ifdef __HUGS__ - (:), -- Not legal Haskell 98 + (:), -- Not legal Haskell 98 #endif - + -- ** Basic type classes Eq((==), (/=)), Ord(compare, (<), (<=), (>=), (>), max, min), @@ -72,7 +72,7 @@ module Prelude ( isInfinite, isDenormalized, isIEEE, isNegativeZero, atan2), -- *** Numeric functions - subtract, even, odd, gcd, lcm, (^), (^^), + subtract, even, odd, gcd, lcm, (^), (^^), fromIntegral, realToFrac, -- ** Monads and functors @@ -87,7 +87,7 @@ module Prelude ( -- * List operations map, (++), filter, - head, last, tail, init, null, length, (!!), + head, last, tail, init, null, length, (!!), reverse, -- ** Reducing lists (folds) foldl, foldl1, foldr, foldr1, @@ -111,12 +111,16 @@ module Prelude ( lines, words, unlines, unwords, -- * Converting to and from @String@ - ReadS, ShowS, - Read(readsPrec, readList), + -- ** Converting to @String@ + ShowS, Show(showsPrec, showList, show), - reads, shows, read, lex, - showChar, showString, readParen, showParen, - + shows, + showChar, showString, showParen, + -- ** Converting from @String@ + ReadS, + Read(readsPrec, readList), + reads, readParen, read, lex, + -- * Basic Input and output IO, -- ** Simple I\/O operations @@ -142,20 +146,17 @@ module Prelude ( #ifndef __HUGS__ import Control.Monad import System.IO -import Text.Read -import Text.Show +import System.IO.Error import Data.List import Data.Either import Data.Maybe -import Data.Bool import Data.Tuple #endif #ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IOBase -import GHC.Exception -import GHC.Read +import Text.Read import GHC.Enum import GHC.Num import GHC.Real @@ -171,11 +172,18 @@ import Hugs.Prelude #ifndef __HUGS__ infixr 0 $! - -- ----------------------------------------------------------------------------- -- Miscellaneous functions +-- | Strict (call-by-value) application, defined in terms of 'seq'. ($!) :: (a -> b) -> a -> b f $! x = x `seq` f x #endif +#ifdef __HADDOCK__ +-- | The value of @'seq' a b@ is bottom if @a@ is bottom, and otherwise +-- equal to @b@. 'seq' is usually introduced to improve performance by +-- avoiding unneeded laziness. +seq :: a -> b -> b +seq _ y = y +#endif