raulraja
07/16/2018, 3:33 PMWell, the first problem is: If I don’t create a companion object forYes that is the expected behavior you need a companion to expand the reference to the type class instance., my code doesn’t compile. That’s easy to workaround, but is it the expected behaviour?Bill
Second: The name of the method I get isIdeally there is a single only one valid instance per type. In that case you may want to extend. What if I would like to create more than one type of monoid for different types of morphisms?monoid()
Monoid
with new type classes Sum
and Product
and create instances for those instead