ch6 in text. typeclasses and implementations