type class monoid = {
op idm : monoid
op (+) : monoid -> monoid -> monoid
...
}.
type class group <: monoid = {
op [-] : group -> group
...
}.
It is currently only possible to instantiate [-] when defining an instance of group, even if an instance of monoid exists. (Ideally, we would want to be able to define the instance of group directly. But defining it by explicit extension of an instance of monoid would be fine as well.)
Consider
It is currently only possible to instantiate
[-]
when defining an instance ofgroup
, even if an instance ofmonoid
exists. (Ideally, we would want to be able to define the instance ofgroup
directly. But defining it by explicit extension of an instance ofmonoid
would be fine as well.)