Lists
The major data type in any functional language is the list. You have already seen a list in the form of a sentence which is in fact a list of words. A list however can contain any type, not just words, including other lists.
Lists are written in square brackets and all elements in the list must be the same type. Here are some examples given with their types:
[1,2,3] :: [Int]
['h', 'e', 'l' ,'l','o'] :: [Char]
[[1,2], [3]] :: [[Int]]
[(+), (*)] :: [Int->Int->Int]
A list with no elements is written as [] and pronounced "nil". To add a single element x to the front of a list xs, we write x : xs. In actuality the list [1,2,3] is equivalent to 1 : (2 : (3 : [])). The list could be visualized as:

Note that a list is not symmetric. It is easy to get the first item in the list but to get to the last item requires marching through the entire list.
Let's define some list operations so we can see how they can be performed. Note that the type specification [a] indicates a list of any type, and that we use pattern matching to define the functions. You may find it helpful to use the substitution model on these functions to see how they behave.
--The length of a list:
len :: [a] -> Int
len [] = 0
len (x:xs) = len xs + 1--The nth item in the list (starting counting at 0)
nth :: Int -> [a] -> a
nth 0 (x:xs) = x
nth n (x:xs) = nth (n-1) xs-- append two lists together
append :: [a] -> [a] -> [a]
append [] y = y
append (x:xs) y = x : (append xs y)
The operations that can be performed on lists is lengthy and is provided here. We will just remark on a few key operations.
head - gives the first item in the list
tail - gives all but the first item
++ - appends two lists together
null - tests to see if a list is empty
There are many higher order functions that operate on lists. Here are some that should seem familiar:
map - applies a function to every member of the list
filter - applies a predicate to a list and keeps on those items satisfying the predicate
foldl - combines a list using a combining function (applied left to right)
foldr - combines a list using a combining function (applied right to left)