Lists and Tuples are useful data structures

Data looks like

Haskell is

More Review

Everything in Haskell has a Type

Here are some Type declarations.

These are your greatest weapons.

head :: [a] -> a -- gets the first element of a list tail :: [a] -> [a] -- gets everything but the first element last :: [a] -> a -- gets the last element of a list init :: [a] -> [a] -- gets everything but the last element (++) :: [a] -> [a] -> [a] -- concatenates two lists together (:) :: a -> [a] -> [a] -- prepends an element to a list fst :: (a,b) -> a -- gets the first element of a tuple snd :: (a,b) -> b -- gets the second element of a tuple

These are the most fundamental and important functions that are used everywhere.