{- reduces a list to a value, going from left to right: applies f to the seed and the first list element, then applies f to the result and the second element etc -}f x y= x+y
foldleft f seed [] = seed
foldleft f seed l =
seed + foldleft f (head l) (tail l)