Traversable typeclass for data structures that can be traversed through.
Covariance: A is declared <out A>. Query (contains) accepts unknown —
mirroring Scala's contains(elem: Any) — so an unrelated-type arg is a
sound false rather than a type error. Aggregations (reduce, reduceRight)
widen the accumulator via <B = A>, matching Scala's reduce[B >: A]; when
called without an explicit type arg the behavior is identical to the pre-0.59
signature, so existing call sites compile unchanged.
Implementers that previously overrode these methods with the widened shape
(List, Set) can inherit from this base without a per-type override.
Traversable typeclass for data structures that can be traversed through.
Covariance: A is declared
<out A>. Query (contains) acceptsunknown— mirroring Scala'scontains(elem: Any)— so an unrelated-type arg is a soundfalserather than a type error. Aggregations (reduce,reduceRight) widen the accumulator via<B = A>, matching Scala'sreduce[B >: A]; when called without an explicit type arg the behavior is identical to the pre-0.59 signature, so existing call sites compile unchanged.Implementers that previously overrode these methods with the widened shape (List, Set) can inherit from this base without a per-type override.