working through defining types and typeclasses