Exercise 4.8: Implemented traverse (in terms of foldRight) and sequence in terms of traverse.