data () = () deriving (Eq, Ord, Enum, Bounded) (see 6.1.5) Instances: Read Show data [a] = [] | a : [a] deriving (Eq, Ord) (see 6.1.3) Instances: Read Show Functor Monad MonadZero MonadPlus data (a,b) = (a,b) deriving (Eq, Ord, Bounded) (see 6.1.4) Instances: Read Show data a->b (see 6.1.7) Instances: Show data Bool = False | True deriving (Eq, Ord, Enum, Read, Show, Bounded) (see 6.1.1) data Char (see 6.1.2) Instances: Eq Ord Enum Read Show data Double (see 6.3) Instances: Eq Ord Enum Read Show Num Real Fractional RealFrac Floating RealFloat data Either a b = Left a | Right b deriving (Eq, Ord, Read, Show) (see 6.1.9) type FilePath = String (see 7.1) data Float (see 6.3) Instances: Eq Ord Enum Read Show Num Real Fractional RealFrac Floating RealFloat data Int (see 6.3) Instances: Eq Ord Enum Read Show Num Real Integral Bounded data Integer (see 6.3) Instances: Eq Ord Enum Read Show Num Real Integral data IO a (see 6.1.8) Instances: Show Functor Monad data IOError (see 6.1.8) Instances: Show Eq data Maybe a = Nothing | Just a deriving (Eq, Ord, Read, Show) (see 6.1.9) Instances: Functor Monad MonadZero MonadPlus data Ordering = LT | EQ | GT deriving (Eq, Ord, Enum, Read, Show, Bounded) (see 6.1.8) type ReadS a = String -> [(a,String)] (see 7) type ShowS = String -> String (see 7) type String = [Char] (see 6.1.2) data Void (see 6.1.6)
[] : (,) EQ False GT Just Left LT Nothing Right True
class Bounded a (see 6.2.6) class Enum a (see 6.2.4) class Eq a (see 6.2.1) class Eval a (see 6.2.7) class (Fractional a) => Floating a (see 6.3) class (Num a) => Fractional a (see 6.3) class Functor f (see 6.2.4) class (Real a, Enum a) => Integral a (see 6.3) class Monad m (see 6.2.4) class (MonadZero m) => MonadPlus m (see 6.2.4) class (Monad m) => MonadZero m (see 6.2.4) class (Eq a, Show a, Eval a) => Num a (see 6.3) class (Eq a) => Ord a (see 6.2.2) class Read a (see 6.2.3) class (Num a, Ord a) => Real a (see 6.3) class (RealFrac a, Floating a) => RealFloat a (see 6.3) class (Real a, Fractional a) => RealFrac a (see 6.3) class Show a (see 6.2.3)
(!!) :: [a] -> Int -> a | [0,1,2] !! 1 = 1 |
($) :: (a -> b) -> a -> b | f x $ g y = f x (g y) |
(&&) :: Bool -> Bool -> Bool | Boolean `and' |
(||) :: Bool -> Bool -> Bool | Boolean `or' |
(*) :: Num a => a -> a -> a | |
(**) :: Floating a => a -> a -> a | |
(+) :: Num a => a -> a -> a | |
(++) :: MonadPlus m => m a -> m a -> m a | "abc" ++ "def" = "abdec" |
(-) :: Num a => a -> a -> a | |
(.) :: (b -> c) -> (a -> b) -> a -> c | Function composition |
(/) :: Fractional a => a -> a -> a | |
(/=) :: Eq a => a -> a -> Bool | not equal |
(<) :: Ord a => a -> a -> Bool | |
(<=) :: Ord a => a -> a -> Bool | |
(==) :: Eq a => a -> a -> Bool | |
(>) :: Ord a => a -> a -> Bool | |
(>=) :: Ord a => a -> a -> Bool | |
(>>) :: m a -> m b -> m b | Monadic binding (see 3.14) |
(>>=) :: Monad m => m a -> (a -> m b) -> m b | Monadic binding (see 3.14) |
(^) :: (Num a, Integral b) => a -> b -> a | |
(^^) :: (Fractional a, Integral b) => a -> b -> a | negative exponent allowed |
abs :: Num a => a -> a | |
accumulate :: Monad m => [m a] -> m [a] | |
acos :: Floating a => a -> a | |
acosh :: Floating a => a -> a | |
all :: (a -> Bool) -> [a] -> Bool | all [True,True,False] = False |
and :: [Bool] -> Bool | and [True, True, True] = True |
any :: (a -> Bool) -> [a] -> Bool | any (== 'c') "abc" = True |
appendFile :: FilePath -> String -> IO () | |
applyM :: Monad m => (a -> m b) -> m a -> m b | |
asTypeOf :: a -> a -> a | Sort of a type cast |
asin :: Floating a => a -> a | |
asinh :: Floating a => a -> a | |
atan :: Floating a => a -> a | |
atan2 :: RealFrac a => a -> a | |
atanh :: Floating a => a -> a | |
break :: (a -> Bool) -> [a] -> ([a], [a]) | break (<2) [1,2,3] = ([1],[2,3]) |
catch :: IO a -> (IOError -> IO a) -> IO a | |
ceiling :: (RealFrac a, Integral b) => a -> b | |
compare :: Ord a => a -> a -> Ordering | |
concat :: MonadPlus m => [m a] -> m a | concat ["a","bc","d"] = "abcd" |
concatMap :: (a -> [b]) -> [a] -> [b] | |
const :: a -> b -> a | |
cos :: Floating a => a -> a | |
cosh :: Floating a => a -> a | |
curry :: ((a, b) -> c) -> a -> b -> c | |
cycle :: [a] -> [a] | cycle "abc" = "abcabcabc ..." |
decodeFloat :: RealFloat a => a -> (Integer, Int) | |
div :: Integral a => a -> a -> a | |
divMod :: Integral a => a -> a -> (a, a) | |
drop :: Int -> [a] -> [a] | drop 2 "abcd" = "cd" |
dropWhile :: (a -> Bool) -> [a] -> [a] | dropWhile (>3) [5,3,5] = [3,5] |
elem :: Eq a => a -> [a] -> Bool | 'a' `Elem` "abc" = True |
encodeFloat :: RealFloat a => Integer -> Int -> a | |
enumFrom :: Enum a => a -> [a] | [n..] |
enumFromThen :: Enum a => a -> a -> [a] | [m,n..] |
enumFromThenTo :: Enum a => a -> a -> a -> [a] | [m,n..o] |
enumFromTo :: Enum a => a -> a -> [a] | [m..n] |
error :: String -> a | (see 3.1) |
even :: Integral a => a -> Bool | |
exp :: Floating a => a -> a | |
exponent :: RealFloat a => a -> Int | |
fail :: IOError -> IO a | |
filter :: MonadZero m => (a -> Bool) -> m a -> m a | filter isUpper "AbCd" = "AB" |
flip :: (a -> b -> c) -> (b -> a -> c) | |
floatDigits :: RealFloat a => a -> Int | |
floatRadix :: RealFloat a => a -> Integer | |
floatRange :: RealFloat a => a -> (Int, Int) | |
floor :: (RealFrac a, Integral b) => a -> b | |
foldl :: (a -> b -> a) -> a -> [b] -> a | foldl (+) [a,b,c] 0 = ((a+b)+c)+0 |
foldl1 :: (a -> a -> a) -> [a] -> a | foldl1 (+) [a,b,c] = (a+b)+c |
foldr :: (a -> b -> b) -> b -> [a] -> b | foldr (+) [a,b,c] 0 = 0+(a+(b+c)) |
foldr1 :: (a -> a -> a) -> [a] -> a | foldr (+) [a,b,c] = a+(b+c) |
fromEnum :: Enum a => a -> Int | |
fromInteger :: Num a => Integer -> a | (see 3.2) |
fromIntegral :: (Integral a, Num b) => a -> b | |
fromRational :: Fractional a => Rational -> a | (see 3.2) |
fromRealFrac :: (RealFrac a, Fractional b) => a -> b | |
fst :: (a, b) -> a | |
gcd :: (Integral a) => a -> a -> a | |
getChar :: IO Char | eof generates an IOError |
getContents :: IO String | |
getLine :: IO Char | eof generates an IOError |
guard :: MonadZero m => Bool -> m () | |
head :: [a] -> a | |
id :: a -> a | |
init :: [a] -> [a] | init "abcd" = "abc" |
interact :: (String -> String) -> IO () | |
isDenormalized :: RealFloat a => a -> Bool | |
isIEEE :: RealFloat a => a -> Bool | |
isInfinite :: RealFloat a => a -> Bool | |
isNaN :: RealFloat a => a -> Bool | |
isNegativeZero :: RealFloat a => a -> Bool | |
iterate :: (a -> a) -> a -> [a] | iterate (++ " ") "" = ["", " ", " ",...] |
last :: [a] -> a | last "abcde" = "e" |
lcm :: Integral a => a -> a -> a | |
length :: [a] -> Int | length "Abc" = 3 |
lex :: ReadS String | lex "abc def" = [("abc"," def")] |
lines :: String -> [String] | |
log :: Floating a => a -> a | |
logBase :: Floating a => a -> a -> a | |
lookup :: Eq a => a -> [(a, b)] -> Maybe b | |
map :: Functor f => (a -> b) -> f a -> f b | |
mapM :: Monad m => (a -> m b) -> [a] -> m [b] | |
mapM_ :: Monad m => (a -> m b) -> [a] -> m () | |
max :: Ord a => a -> a -> a | |
maxBound :: Bounded a => a | |
maximum :: Ord a => [a] -> a | |
maybe :: b -> (a -> b) -> Maybe a -> b | maybe 0 (+1) (Just 1) = 2 |
min :: Ord a => a -> a -> a | |
minBound :: Bounded a => a | |
minimum :: Ord a => [a] -> a | |
mod :: Integral a => a -> a -> a | |
negate :: Num a => a -> a | |
not :: Bool -> Bool | |
notElem :: Eq a => a -> [a] -> Bool | |
null :: [a] -> Bool | |
odd :: Integral a => a -> Bool | |
or :: [Bool] -> Bool | |
otherwise :: Bool | |
pi :: Floating a => a | |
pred :: Enum a => a -> a | pred True = False |
print :: Show a => IO () | adds a newline |
product :: Num a => [a] -> a | |
properFraction :: (RealFrac a, Integral b) => a -> (b, a) | |
putChar :: Char -> IO () | |
putStr :: String -> IO () | |
putStrLn :: String -> IO () | adds a newline |
quot :: Integral a => a -> a -> a | |
quotRem :: Integral a => a -> a -> (a, a) | |
read :: Read a => String -> a | |
readFile :: FilePath -> IO String | |
readIO :: Read a => String -> IO a | fails with IOError |
readList :: Read a => ReadS [a] | |
readLn :: Read a => IO a | |
readParen :: Bool -> ReadS a -> ReadS a | |
reads :: Read a => ReadS a | reads "1 2" :: [(Int,String)] = [(1," 2")] |
readsPrec :: Read a => Int -> ReadS a | |
recip :: Fractional a => a -> a | |
rem :: Integral a => a -> a -> a | |
repeat :: a -> [a] | repeat 'a' = "aaaaaaaaa..." |
replicate :: Int -> a -> [a] | replicate 4 'a' = "aaaa" |
return :: Monad m => a -> m a | |
reverse :: [a] -> [a] | reverse "abc" = "cba" |
round :: (RealFrac a, Integral b) => a -> b | |
scaleFloat :: RealFloat a => Int -> a -> a | |
scanl :: (a -> b -> a) -> a -> [b] -> [a] | scanl (+) 0 [1,2,3] = [1,3,6] |
scanl1 :: (a -> a -> a) -> [a] -> [a] | scanl1 (+) [1,2,3] = [1,3,6] |
scanr :: (a -> b -> b) -> b -> [a] -> [b] | scanr (+) 0 [1,2,3] = [6,5,1,0] |
scanr1 :: (a -> a -> a) -> [a] -> [a] | scanr (+) [1,2,3] = [6,5,1] |
seq :: Eval a => a -> a -> b | (see 6.2.7) |
sequence :: Monad m => [m a] -> m () | do operations in sequence |
show :: Show a => a -> String | (see 6.2.3) |
showChar :: Char -> ShowS | |
showList :: Show a => [a] -> ShowS | |
showParen :: Bool -> ShowS -> ShowS | |
showString :: String -> ShowS | |
shows :: Show a => a -> ShowS | (see 6.2.3) |
showsPrec :: Show a => Int -> a -> ShowS | (see 6.2.3) |
significand :: RealFloat a => a -> a | |
signum :: Num a => a -> a | |
sin :: Floating a => a -> a | |
sinh :: Floating a => a -> a | |
snd :: (a, b) -> b | |
span :: (a -> Bool) -> [a] -> ([a], [a]) | span isAlpha "ab cd" = ("ab"," cd") |
splitAt :: Int -> [a] -> ([a], [a]) | splitAt 2 "abcdef" = ("ab","cdef") |
sqrt :: Floating a => a -> a | |
strict :: Eval a => (a -> b) -> (a -> b) | (see 6.2.7) |
subtract :: Num a => a -> a -> a | |
succ :: Enum a => a -> a | succ False = True |
sum :: Num a => [a] -> a | sum [1,2,3] = 6 |
tail :: [a] -> [a] | tail "abc" = "bc" |
take :: Int -> [a] -> [a] | take 3 "abcde" = "abc" |
takeWhile :: (a -> Bool) -> [a] -> [a] | takeWhile (> 2) [3,2,1] = [3] |
tan :: Floating a => a -> a | |
tanh :: Floating a => a -> a | |
toEnum :: Enum a => Int -> a | toEnum 0 :: Bool = False |
toInteger :: Integral a => a -> Integer | |
toRational :: Real a => a -> Rational | |
truncate :: (RealFrac a, Integral b) => a -> b | |
uncurry :: (a -> b -> c) -> ((a, b) -> c) | |
undefined :: a | (see 3.1) |
unlines :: [String] -> String | |
until :: (a -> Bool) -> (a -> a) -> a -> a | until (> 3) (+ 2) 0 = 4 |
unwords :: [String] -> String | |
unzip :: [(a, b)] -> ([a], [b]) | unzip [('a','b'),('c','d')] = ["ac",bd"] |
unzip3 :: [(a, b, c)] -> ([a], [b], [c]) | |
userError :: String -> IOError | |
words :: String -> [String] | words "ab d as+3" = ["ab","d","as+3"] |
writeFile :: FilePath -> String -> IO () | |
zero :: MonadZero m => m a | |
zip :: [a] -> [b] -> [(a, b)] | zip "abc" "de" = [('a','d'), ('b',e')] |
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] | |
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] | zipWith (+) [1,2] [3,4] = [4,7] |
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] |