How do I get an instance of the type class associated with a context bound?
Using the implicitly method The most common and general approach is to use the implicitly method, defined in Predef: def add[T: Numeric](x: T, y: T) = implicitly[Numeric[T]].plus(x,y) Obviously, this is somewhat verbose and requires repeating the name of the type class. Referencing the evidence parameter (don’t!) Another alternative is to use the name of the … Read more