The Scala standard library provides evidence of two types being equal at the data level: a value of type (A =:= B) witnesses that A and B are the same type. Accordingly, it provides an implicit conversion from A to B. So you can write Int-summing functions on your generic foldable types. final case class XList[A](xs: List[A]) { def sum(implicit ev: A =:= Int): Int = xs.foldLeft(0)(_ + _) } That works because ev is inserted as an implicit conversion over that lambda’s second parameter. Fra...