An exercise to brush up on my Haskell