require a more general type for eqWith and compareWith