My question regards the new typeclass syntax introduced with the experimental.modularity feature set.
I want to define a typeclass Lattice { type Self }, which ought to extend the already existing PartialOrdering[T] typeclass. I’m really enjoying the new Self member type syntax, and am using it throughout my project. Is there anyway I can define Lattice using the new syntax, and still extend PartialOrdering[T]? Something akin to trait Lattice extends PartialOrdering[this.Self]?
I don’t know the answer to your question (haven’t used the new syntax yet), but just to get the ball rolling, do you mean a “new syntax equivalent” of:
No that would not work, unfortunately. You can’t use this in parent types. We still have to figure out how to best blend parameters and type members in these cases.
That’s not quite what I’m looking for. I want the Lattice typeclass to extend the PartialOrdering typeclass. If I was using the old syntax I could achieve this as follows: trait Lattice[T] extends PartialOrdering[T].