coulomb
coulomb copied to clipboard
Should the unit type `U` in Quantity[N, U] be covariant?
trait Fruit
trait Apple extends Fruit
trait Pear extends Fruit
val q1 = 1.withUnit[Apple] + 1.withUnit[Pear] // is q1 Quantity[Int, Fruit] ?
def f1(f: Quantity[Int, Fruit]) = { ... }
f1(1.withUnit[Apple])
f1(1.withUnit[Pear])
would likely depend on #22