fpinscala: chapter 03 work