Also, the “fake covariance” trick. Sometimes, Scala programmers notice a nice optimization they can use in the case of a class that has an invariant type parameter, but in which that type parameter appears in variant or phantom position in the actual data involved. =:= is an example of the phantom case. sealed abstract class =:=[From, To] extends (From => To) with Serializable scala.collection.immutable.Set is an example of the covariant case. Here is the optimization, which is very simil...