-- so far I have only used numbers in the form of ints and floats, and only ever one type in an entire function. This is of course limited. -- Other types include char (single character), String, and more general types like tuples and lists. function1 :: Char->Char function1 'a' = 'b' function1 _ = 'a' function2 :: String->String function2 "hello" = "goodbye" function2 _ = "hello world" -- a more complex data type is the tuple. A tuple is a finite set of different data types, like so function3 :: (Char,Int)->(Char,Int) function3 ('a',5) = ('c',6) function3 _ = ('b',2) -- next a list, a list can be of any length (in the above example a tuple has only 2 elements of fixed -- type), but every element must be the same. For example a list of Ints function4 :: [Int]->[Int] function4 inList = inList -- lists can be defined in quite complex ways using 'generators' function5 :: [Int]->[Int] function5 xs = [x+1 | x<-xs] -- this function would take a list and generate a new list, where each element is incremented by one -- other things that can be done in Haskell are infinate lists, defined in various ways, but most -- commonly something like [1..] for the list of numbers 1,2,3,4... It is also possible to limit this -- infinate generation by doing something like [1..6] -- other things can be done, such as the following function6 :: [(Int,Int)] function6 = [(x,y) | x<-[0..6],y<-[30..36]] function7 :: [(Int,Int)] function7 = [(x,y) | x<-[0..6],y<-[3..9],x*y<17] -- finally, function can be variables too, but this will be returned too in later examples