A lot can be done with enrichments though.
implicit class ClampingOps[A](underlying: A) {
def clamp(lowerBound: A, upperBound: A)(implicit n: Numeric[A]): A = n.max(lowerBound, n.min(underlying, upperBound))
}
in a package scala.backports
or something like that would accomplish the same, at the cost of import scala.backports._
.