Implementation of a polymorphic computation on an Entity using a Type Class