After going through a few examples, I have to say, I fail to understand what the F-Bounded polymorphic brings.
To use the example from scala school (https://twitt
The advantage would come when it looks something like this:
trait Container[A <: Container[A]] extends Ordered[A] {
def clone: A
def pair: (A, A) = (clone, clone)
}
class MyContainer extends Container[MyContainer] {
def clone = new MyContainer
}
Now you get pair
for free, and you get the correct return type. Without something like this you must manually override every single method that returns the same type (lots of pointless boilerplate), or you lose specificity in your types as soon as you call a non-overridden method.