Exercise 3.11: Write sum, product, and a function to compute the length of a list using foldLeft.