check superclasses when deriving instances of type classes