Haskell Hierarchical Libraries (base package)ContentsIndex
Prelude
Portabilityportable
Stabilitystable
Maintainerlibraries@haskell.org
Contents
Standard types, classes and related functions
Basic data types
Tuples
Basic type classes
Numbers
Numeric types
Numeric type classes
Numeric functions
Monads and functors
Miscellaneous functions
List operations
Reducing lists (folds)
Special folds
Building lists
Scans
Infinite lists
Sublists
Searching lists
Zipping and unzipping lists
Functions on strings
Converting to and from String
Converting to String
Converting from String
Basic Input and output
Simple I/O operations
Output functions
Input functions
Files
Exception handling in the I/O monad
Description
The Prelude: a standard module imported by default into all Haskell modules. For more documentation, see the Haskell 98 Report http://www.haskell.org/onlinereport/.
Synopsis
data Bool
= False
| True
(&&) :: Bool -> Bool -> Bool
(||) :: Bool -> Bool -> Bool
not :: Bool -> Bool
otherwise :: Bool
data Maybe a
= Nothing
| Just a
maybe :: b -> (a -> b) -> Maybe a -> b
data Either a b
= Left a
| Right b
either :: (a -> c) -> (b -> c) -> Either a b -> c
data Ordering
= LT
| EQ
| GT
data Char
type String = [Char]
fst :: (a, b) -> a
snd :: (a, b) -> b
curry :: ((a, b) -> c) -> a -> b -> c
uncurry :: (a -> b -> c) -> (a, b) -> c
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
class Eq a => Ord a where
compare :: a -> a -> Ordering
(<) :: a -> a -> Bool
(<=) :: a -> a -> Bool
(>) :: a -> a -> Bool
(>=) :: a -> a -> Bool
max :: a -> a -> a
min :: a -> a -> a
class Enum a where
succ :: a -> a
pred :: a -> a
toEnum :: Int -> a
fromEnum :: a -> Int
enumFrom :: a -> [a]
enumFromThen :: a -> a -> [a]
enumFromTo :: a -> a -> [a]
enumFromThenTo :: a -> a -> a -> [a]
class Bounded a where
minBound :: a
maxBound :: a
data Int
data Integer
data Float
data Double
type Rational = Ratio Integer
class (Eq a, Show a) => Num a where
(+) :: a -> a -> a
(-) :: a -> a -> a
(*) :: a -> a -> a
negate :: a -> a
abs :: a -> a
signum :: a -> a
fromInteger :: Integer -> a
class (Num a, Ord a) => Real a where
toRational :: a -> Rational
class (Real a, Enum a) => Integral a where
quot :: a -> a -> a
rem :: a -> a -> a
div :: a -> a -> a
mod :: a -> a -> a
quotRem :: a -> a -> (a, a)
divMod :: a -> a -> (a, a)
toInteger :: a -> Integer
class Num a => Fractional a where
(/) :: a -> a -> a
recip :: a -> a
fromRational :: Rational -> a
class Fractional a => Floating a where
pi :: a
exp :: a -> a
log :: a -> a
sqrt :: a -> a
(**) :: a -> a -> a
logBase :: a -> a -> a
sin :: a -> a
cos :: a -> a
tan :: a -> a
asin :: a -> a
acos :: a -> a
atan :: a -> a
sinh :: a -> a
cosh :: a -> a
tanh :: a -> a
asinh :: a -> a
acosh :: a -> a
atanh :: a -> a
class (Real a, Fractional a) => RealFrac a where
properFraction :: Integral b => a -> (b, a)
truncate :: Integral b => a -> b
round :: Integral b => a -> b
ceiling :: Integral b => a -> b
floor :: Integral b => a -> b
class (RealFrac a, Floating a) => RealFloat a where
floatRadix :: a -> Integer
floatDigits :: a -> Int
floatRange :: a -> (Int, Int)
decodeFloat :: a -> (Integer, Int)
encodeFloat :: Integer -> Int -> a
exponent :: a -> Int
significand :: a -> a
scaleFloat :: Int -> a -> a
isNaN :: a -> Bool
isInfinite :: a -> Bool
isDenormalized :: a -> Bool
isNegativeZero :: a -> Bool
isIEEE :: a -> Bool
atan2 :: a -> a -> a
subtract :: Num a => a -> a -> a
even :: Integral a => a -> Bool
odd :: Integral a => a -> Bool
gcd :: Integral a => a -> a -> a
lcm :: Integral a => a -> a -> a
(^) :: (Num a, Integral b) => a -> b -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
fromIntegral :: (Integral a, Num b) => a -> b
realToFrac :: (Real a, Fractional b) => a -> b
class Monad m where
(>>=) :: forall a b . m a -> (a -> m b) -> m b
(>>) :: forall a b . m a -> m b -> m b
return :: a -> m a
fail :: String -> m a
class Functor f where
fmap :: (a -> b) -> f a -> f b
mapM :: Monad m => (a -> m b) -> [a] -> m [b]
mapM_ :: Monad m => (a -> m b) -> [a] -> m ()
sequence :: Monad m => [m a] -> m [a]
sequence_ :: Monad m => [m a] -> m ()
(=<<) :: Monad m => (a -> m b) -> m a -> m b
id :: a -> a
const :: a -> b -> a
(.) :: (b -> c) -> (a -> b) -> a -> c
flip :: (a -> b -> c) -> b -> a -> c
($) :: (a -> b) -> a -> b
until :: (a -> Bool) -> (a -> a) -> a -> a
asTypeOf :: a -> a -> a
error :: String -> a
undefined :: a
seq :: a -> b -> b
($!) :: (a -> b) -> a -> b
map :: (a -> b) -> [a] -> [b]
(++) :: [a] -> [a] -> [a]
filter :: (a -> Bool) -> [a] -> [a]
head :: [a] -> a
last :: [a] -> a
tail :: [a] -> [a]
init :: [a] -> [a]
null :: [a] -> Bool
length :: [a] -> Int
(!!) :: [a] -> Int -> a
reverse :: [a] -> [a]
foldl :: (a -> b -> a) -> a -> [b] -> a
foldl1 :: (a -> a -> a) -> [a] -> a
foldr :: (a -> b -> b) -> b -> [a] -> b
foldr1 :: (a -> a -> a) -> [a] -> a
and :: [Bool] -> Bool
or :: [Bool] -> Bool
any :: (a -> Bool) -> [a] -> Bool
all :: (a -> Bool) -> [a] -> Bool
sum :: Num a => [a] -> a
product :: Num a => [a] -> a
concat :: [[a]] -> [a]
concatMap :: (a -> [b]) -> [a] -> [b]
maximum :: Ord a => [a] -> a
minimum :: Ord a => [a] -> a
scanl :: (a -> b -> a) -> a -> [b] -> [a]
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr1 :: (a -> a -> a) -> [a] -> [a]
iterate :: (a -> a) -> a -> [a]
repeat :: a -> [a]
replicate :: Int -> a -> [a]
cycle :: [a] -> [a]
take :: Int -> [a] -> [a]
drop :: Int -> [a] -> [a]
splitAt :: Int -> [a] -> ([a], [a])
takeWhile :: (a -> Bool) -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
span :: (a -> Bool) -> [a] -> ([a], [a])
break :: (a -> Bool) -> [a] -> ([a], [a])
elem :: Eq a => a -> [a] -> Bool
notElem :: Eq a => a -> [a] -> Bool
lookup :: Eq a => a -> [(a, b)] -> Maybe b
zip :: [a] -> [b] -> [(a, b)]
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
unzip :: [(a, b)] -> ([a], [b])
unzip3 :: [(a, b, c)] -> ([a], [b], [c])
lines :: String -> [String]
words :: String -> [String]
unlines :: [String] -> String
unwords :: [String] -> String
type ShowS = String -> String
class Show a where
showsPrec :: Int -> a -> ShowS
show :: a -> String
showList :: [a] -> ShowS
shows :: Show a => a -> ShowS
showChar :: Char -> ShowS
showString :: String -> ShowS
showParen :: Bool -> ShowS -> ShowS
type ReadS a = String -> [(a, String)]
class Read a where
readsPrec :: Int -> ReadS a
readList :: ReadS [a]
reads :: Read a => ReadS a
readParen :: Bool -> ReadS a -> ReadS a
read :: Read a => String -> a
lex :: ReadS String
data IO a
putChar :: Char -> IO ()
putStr :: String -> IO ()
putStrLn :: String -> IO ()
print :: Show a => a -> IO ()
getChar :: IO Char
getLine :: IO String
getContents :: IO String
interact :: (String -> String) -> IO ()
type FilePath = String
readFile :: FilePath -> IO String
writeFile :: FilePath -> String -> IO ()
appendFile :: FilePath -> String -> IO ()
readIO :: Read a => String -> IO a
readLn :: Read a => IO a
type IOError = IOException
ioError :: IOError -> IO a
userError :: String -> IOError
catch :: IO a -> (IOError -> IO a) -> IO a
Standard types, classes and related functions
Basic data types
data Bool
The Bool type is an enumeration. It is defined with False first so that the corresponding Enum instance will give fromEnum False the value zero, and fromEnum True the value 1.
Constructors
False
True
show/hide Instances
(&&) :: Bool -> Bool -> Bool
Boolean "and"
(||) :: Bool -> Bool -> Bool
Boolean "or"
not :: Bool -> Bool
Boolean "not"
otherwise :: Bool

otherwise is defined as the value True. It helps to make guards more readable. eg.

  f x | x < 0     = ...
      | otherwise = ...
data Maybe a

The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.

The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.

Constructors
Nothing
Just a
show/hide Instances
maybe :: b -> (a -> b) -> Maybe a -> b
The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.
data Either a b

The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.

The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").

Constructors
Left a
Right b
show/hide Instances
Typeable2 Either
(Data a, Data b) => Data (Either a b)
(Eq a, Eq b) => Eq (Either a b)
(Ord a, Ord b) => Ord (Either a b)
(Read a, Read b) => Read (Either a b)
(Show a, Show b) => Show (Either a b)
either :: (a -> c) -> (b -> c) -> Either a b -> c
Case analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b.
data Ordering
Represents an ordering relationship between two values: less than, equal to, or greater than. An Ordering is returned by compare.
Constructors
LT
EQ
GT
show/hide Instances
data Char

The character type Char is an enumeration whose values represent Unicode (or equivalently ISO 10646) characters. This set extends the ISO 8859-1 (Latin-1) character set (the first 256 charachers), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.

To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).

show/hide Instances
type String = [Char]
A String is a list of characters. String constants in Haskell are values of type String.
Tuples
fst :: (a, b) -> a
Extract the first component of a pair.
snd :: (a, b) -> b
Extract the second component of a pair.
curry :: ((a, b) -> c) -> a -> b -> c
curry converts an uncurried function to a curried function.
uncurry :: (a -> b -> c) -> (a, b) -> c
uncurry converts a curried function to a function on pairs.
Basic type classes
class Eq a where

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

Minimal complete definition: either == or /=.

Methods
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
show/hide Instances
Eq ArithException
Eq ArrayException
Eq AsyncException
Eq Bool
Eq BufferMode
Eq BufferState
Eq CCc
Eq CChar
Eq CClock
Eq CDev
Eq CDouble
Eq CFloat
Eq CGid
Eq CIno
Eq CInt
Eq CLDouble
Eq CLLong
Eq CLong
Eq CMode
Eq CNlink
Eq COff
Eq CPid
Eq CPtrdiff
Eq CRLim
Eq CSChar
Eq CShort
Eq CSigAtomic
Eq CSize
Eq CSpeed
Eq CSsize
Eq CTcflag
Eq CTime
Eq CUChar
Eq CUInt
Eq CULLong
Eq CULong
Eq CUShort
Eq CUid
Eq CWchar
Eq CalendarTime
Eq Char
Eq ClockTime
Eq Constr
Eq ConstrRep
Eq DataRep
Eq Day
Eq Double
Eq Errno
Eq Exception
Eq ExitCode
Eq FDType
Eq Fd
Eq Fixity
Eq Float
Eq GeneralCategory
Eq Handle
Eq HandlePosn
Eq IOErrorType
Eq IOException
Eq IOMode
Eq Int
Eq Int16
Eq Int32
Eq Int64
Eq Int8
Eq IntSet
Eq Integer
Eq Key
Eq KeyPr
Eq Lexeme
Eq Month
Eq Ordering
Eq PackedString
Eq Permissions
Eq SeekMode
Eq ThreadId
Eq TimeDiff
Eq TimeLocale
Eq TyCon
Eq TypeRep
Eq Unique
Eq Version
Eq Word
Eq Word16
Eq Word32
Eq Word64
Eq Word8
Eq ()
(Eq a, Eq b) => Eq (a, b)
(Eq a, Eq b, Eq c) => Eq (a, b, c)
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
(RealFloat a, Eq a) => Eq (Complex a)
Eq (ForeignPtr a)
Eq (FunPtr a)
Eq (IORef a)
Eq a => Eq (IntMap a)
Eq (MVar a)
Eq a => Eq (Maybe a)
Eq (Ptr a)
(Integral a, Eq a) => Eq (Ratio a)
Eq a => Eq (Set a)
Eq (StableName a)
Eq (StablePtr a)
Eq (TVar a)
Eq a => Eq (Tree a)
Eq a => Eq [a]
(Ix i, Eq e) => Eq (Array i e)
(Eq a, Eq b) => Eq (Either a b)
(Eq key, Eq elt) => Eq (FiniteMap key elt)
Eq (IOArray i e)
(Eq k, Eq a) => Eq (Map k a)
Eq (STRef s a)
Ix ix => Eq (UArray ix Bool)
Ix ix => Eq (UArray ix Char)
Ix ix => Eq (UArray ix Double)
Ix ix => Eq (UArray ix Float)
Ix ix => Eq (UArray ix (FunPtr a))
Ix ix => Eq (UArray ix Int)
Ix ix => Eq (UArray ix Int16)
Ix ix => Eq (UArray ix Int32)
Ix ix => Eq (UArray ix Int64)
Ix ix => Eq (UArray ix Int8)
Ix ix => Eq (UArray ix (Ptr a))
Ix ix => Eq (UArray ix (StablePtr a))
Ix ix => Eq (UArray ix Word)
Ix ix => Eq (UArray ix Word16)
Ix ix => Eq (UArray ix Word32)
Ix ix => Eq (UArray ix Word64)
Ix ix => Eq (UArray ix Word8)
Eq (STArray s i e)
class Eq a => Ord a where

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Methods
compare :: a -> a -> Ordering
(<) :: a -> a -> Bool
(<=) :: a -> a -> Bool
(>) :: a -> a -> Bool
(>=) :: a -> a -> Bool
max :: a -> a -> a
min :: a -> a -> a
show/hide Instances
Ord ArithException
Ord ArrayException
Ord AsyncException
Ord Bool
Ord BufferMode
Ord CCc
Ord CChar
Ord CClock
Ord CDev
Ord CDouble
Ord CFloat
Ord CGid
Ord CIno
Ord CInt
Ord CLDouble
Ord CLLong
Ord CLong
Ord CMode
Ord CNlink
Ord COff
Ord CPid
Ord CPtrdiff
Ord CRLim
Ord CSChar
Ord CShort
Ord CSigAtomic
Ord CSize
Ord CSpeed
Ord CSsize
Ord CTcflag
Ord CTime
Ord CUChar
Ord CUInt
Ord CULLong
Ord CULong
Ord CUShort
Ord CUid
Ord CWchar
Ord CalendarTime
Ord Char
Ord ClockTime
Ord Day
Ord Double
Ord ExitCode
Ord Fd
Ord Float
Ord GeneralCategory
Ord IOMode
Ord Int
Ord Int16
Ord Int32
Ord Int64
Ord Int8
Ord IntSet
Ord Integer
Ord Month
Ord Ordering
Ord PackedString
Ord Permissions
Ord SeekMode
Ord ThreadId
Ord TimeDiff
Ord TimeLocale
Ord Unique
Ord Version
Ord Word
Ord Word16
Ord Word32
Ord Word64
Ord Word8
Ord ()
(Ord a, Ord b) => Ord (a, b)
(Ord a, Ord b, Ord c) => Ord (a, b, c)
(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
Ord (ForeignPtr a)
Ord (FunPtr a)
Ord a => Ord (IntMap a)
Ord a => Ord (Maybe a)
Ord (Ptr a)
Integral a => Ord (Ratio a)
Ord a => Ord (Set a)
Ord a => Ord [a]
(Ix i, Ord e) => Ord (Array i e)
(Ord a, Ord b) => Ord (Either a b)
(Ord k, Ord v) => Ord (Map k v)
Ix ix => Ord (UArray ix Bool)
Ix ix => Ord (UArray ix Char)
Ix ix => Ord (UArray ix Double)
Ix ix => Ord (UArray ix Float)
Ix ix => Ord (UArray ix (FunPtr a))
Ix ix => Ord (UArray ix Int)
Ix ix => Ord (UArray ix Int16)
Ix ix => Ord (UArray ix Int32)
Ix ix => Ord (UArray ix Int64)
Ix ix => Ord (UArray ix Int8)
Ix ix => Ord (UArray ix (Ptr a))
Ix ix => Ord (UArray ix Word)
Ix ix => Ord (UArray ix Word16)
Ix ix => Ord (UArray ix Word32)
Ix ix => Ord (UArray ix Word64)
Ix ix => Ord (UArray ix Word8)
class Enum a where

Class Enum defines operations on sequentially ordered types.

The enumFrom... methods are used in Haskell's translation of arithmetic sequences.

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class Bounded as well as Enum, the following should hold:

	enumFrom     x   = enumFromTo     x maxBound
	enumFromThen x y = enumFromThenTo x y bound
	  where
	    bound | fromEnum y >= fromEnum x = maxBound
	          | otherwise                = minBound
Methods
succ :: a -> a
the successor of a value. For numeric types, succ adds 1.
pred :: a -> a
the predecessor of a value. For numeric types, pred subtracts 1.
toEnum :: Int -> a
Convert from an Int.
fromEnum :: a -> Int
Convert to an Int. It is implementation-dependent what fromEnum returns when applied to a value that is too large to fit in an Int.
enumFrom :: a -> [a]
Used in Haskell's translation of [n..].
enumFromThen :: a -> a -> [a]
Used in Haskell's translation of [n,n'..].
enumFromTo :: a -> a -> [a]
Used in Haskell's translation of [n..m].
enumFromThenTo :: a -> a -> a -> [a]
Used in Haskell's translation of [n,n'..m].
show/hide Instances
class Bounded a where

The Bounded class is used to name the upper and lower limits of a type. Ord is not a superclass of Bounded since types that are not totally ordered may also have upper and lower bounds.

The Bounded class may be derived for any enumeration type; minBound is the first constructor listed in the data declaration and maxBound is the last. Bounded may also be derived for single-constructor datatypes whose constituent types are in Bounded.

Methods
minBound :: a
maxBound :: a
show/hide Instances