Numbers

3+2 3-2 3*2 3/2 3^2 3**2.5
div3 2 mod3 2 ...
max3 4 min3 4 abs(-3)
odd3 even3 gcd4 6 lcm4 6
floor3.6 round3.6 ceiling3.6
sum[1..5] product[1..5]
maximum[1,3,2] minimum[1,3,2]
pi sqrt2 sin0.4 cos0.4 ...

Booleans

3>2 3>=2 3<2 3<=2 3==2 3/=2
True&&False True||False notTrue
and[False, False, True] or[False, False, True]

Constructing Lists

'h':"ello" "he"++"llo" replicate3 'a'
concat["he", "ll", "o"] ...
intersperse',' "abc" intercalate"--" ["one", "two"]

Querying Lists

null"abc" length"abc"
eleme "hello" findodd [2,4,5,6] ...
isPrefixOf"he" "hello" ...
FindIndexodd [2,3,5] FindIndicesodd [2,3,5]

Extracting from Lists

"hello"!!4
head"abc" tail"abc" init"abc" last"abc"
take2 "hello" drop2 "hello"
takeWhileodd [1,3,2] dropWhileodd [1,3,2]
stripPrefix"he" "hello"

Splitting Lists

splitAt2 "hello" spanodd [1,3,4] breakeven [1,3,4]
partitionodd [1,2,3,4]

Infinite lists

iterate(+1) 0 repeat'a' cycle"hello"

Lists as sets

nub"mississippi"
delete'e' "hello"
"ab"\\"ac" union"ab" "ac" ...

Sorting

sort[3,4,2] ... insert3 [1,2,4] ... compare3 4

Misc Lists

zip[1..] "hello" zipWith(+) [1,2,3] [4,5,6] ...
unzip[(4,'a'),(5,'z')] ...
reverse"hi" transpose["abc", "123"]
subsequences"abc" permutations"abc"
group"hello"
inits"abc" tails"abc"

Strings

lines"one\ntwo\n" unlines["one", "two"]
words"one two" unwords["one", "two"]
show3 read"3"

Characters

toUpper'a' toLower'A'
digitToInt'5' intToDigit5
ord'A' chr65
isNumber'4' isLetter'a' ...

Higher order

mapsqrt [1..5] filterodd [1..5]
allodd [2,3,4] anyodd [2,3,4]
sqrt.sqrt sqrt$4 fliptake
foldr(+) 0 [1..5] foldl'(+) 0 [1..5] ...
scanr(+) 0 [1..5] scanl'(+) 0 [1..5] ...

I/O

main interact$ map toUpper
putChar'a' putStr"hi" putStrLn"hi" print4
getchar getLine getContents
readFile"a.txt"
writeFile"a.txt" "hello" appendFile"a.txt" "hello"

Misc

fst(3,"hi") snd(3,"hi") id3 const3 "hi"