Prelude

Standard types, classes and related functions

Basic data types

otherwise

data Maybe a

maybe

data Either a b

either

type String

Tuples

fst

snd

curry

uncurry

Basic type classes

class Enum a

class Bounded a

Numbers

Numeric types

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

undefined

($!)

List operations

map

(++)

Reducing lists (folds)

foldl1

foldr

Special folds

sum

product

maximum

minimum

Building lists

Scans

Infinite lists

Sublists

Searching lists

Zipping and unzipping lists

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

reads

read

Basic Input and output

Simple I/O operations

Output functions

putChar

putStr

putStrLn

print

Input functions

getChar

getLine

getContents

interact

Files

readFile

writeFile

appendFile

readIO

readLn

Exception handling in the I/O monad

catch