
23 Dec
2013
23 Dec
'13
9:57 a.m.
Eg for a definition of reverse: reverse' :: [a] -> [a] reverse' [] = [] reverse' (x:xs) = reverse' xs ++ [x] In the last line of the definition, x is an element in the list (the first element) and xs represents the remainder of the list. so if list was [1,2,3] then x is 1 and xs is [2,3] Why are the brackets required? And what do they signify? Eg reverse' x:xs = reverse' xs ++ [x] results in a parse error.