Exercise 46 in HtDP.