How to take advantage of mkNumericOps in Scala?
问题 I'm trying to define a new type that can behave essentially like a number (for concreteness, let's say a Double ). I'd like to overload operators on this type and I could do this explicitly, but to avoid repetition, I would like to advantage of the methods in NumericOps, which are defined in terms of the abstract methods in Numeric. My understanding is I should be able to just override the methods in Numeric and get the others for free. Here's the simplest attempt I can think of: class