Typeclass demo (with inheritance)