usage example of type classes from chapter 7