Exercise 10.12 partially solved (foldright for ListFoldable)