Is F -bound polymorphism useful?

Isn’t that still f-bounded polymorphism*? It should be isomorphic to this f-bounded trait:

trait TGrid[TileT, GridT[A] <: TGrid[A, GridT]]

Most of the time the one with the type member should be a lot nicer at the use site. The unfortunate thing is that you can’t use a type member in the self-type.


* to really be the same thing I guess you’d need to have this:

trait TGrid[TileT] { 
  self => 

  type GridT[A] <: TGrid[A] { type GridT[A] = self.GridT[A] } 
}

So it’s basically a weaker version of f-bounded polymorphism.

1 Like