chapter 5: exercise 13 - takeWhile via unfold