Prelude

Standard types, classes and related functions

Basic data types

data Bool

(&&)

(||)

not

otherwise

data Maybe a

maybe

data Either a b

either

data Ordering

data Char

type String

Tuples

fst

snd

curry

uncurry

Basic type classes

class Eq a

class Ord a

class Enum a

class Bounded a

Numbers

Numeric types

data Int

data Integer

data Float

data Double

type Rational

Numeric type classes

class Num a

class Real a

class Integral a

class Fractional a

class Floating a

class RealFrac a

class RealFloat a

Numeric functions

subtract

even

odd

gcd

lcm

(^)

(^^)

fromIntegral

realToFrac

Monads and functors

class Monad m

class Functor f

mapM

mapM_

sequence

sequence_

(=<<)

Miscellaneous functions

id

const

(.)

flip

($)

until

asTypeOf

error

undefined

seq

($!)

List operations

map

(++)

filter

head

last

tail

init

null

length

(!!)

reverse

Reducing lists (folds)

foldl

foldl1

foldr

foldr1

Special folds

and

or

any

all

sum

product

concat

concatMap

maximum

minimum

Building lists

Scans

scanl

scanl1

scanr

scanr1

Infinite lists

iterate

repeat

replicate

cycle

Sublists

take

drop

splitAt

takeWhile

dropWhile

span

break

Searching lists

elem

notElem

lookup

Zipping and unzipping lists

zip

zip3

zipWith

zipWith3

unzip

unzip3

Functions on strings

lines

words

unlines

unwords

Converting to and from String

Converting to String

type ShowS

class Show a

shows

showChar

showString

showParen

Converting from String

type ReadS a

class Read a

reads

readParen

read

lex

Basic Input and output

data IO a

Simple I/O operations

Output functions

putChar

putStr

putStrLn

print

Input functions

getChar

getLine

getContents

interact

Files

type FilePath

readFile

writeFile

appendFile

readIO

readLn

Exception handling in the I/O monad

type IOError

ioError

userError