Slide 53
Slide 53 text
Why specialize to Double? In fact, why specialize to
Vector[_]?
We only care we can add, subtract, and multiply the “inner”
type!
Put another way, we care it forms a Rng!
trait Rng[A] {
def negate(x: A): A
def plus(x: A, y: A): A
def times(x: A, y: A): A
def zero: A
}
trait Module[V, R] {
implicit abstract def scalar: Rng[R]
}