Exercise 5.5: Use foldRight to implement takeWhile.