fold f accum [] = accum fold f accum (x:xs) = fold f (f x accum) xs