raulraja
08/19/2017, 8:39 PMNumeric
representation similar in concept to what you were asking about https://github.com/scala/scala/blob/v2.12.3/src/library/scala/math/Numeric.scala#L1 Something similar may be doable in Kotlin, though Numeric
is a typeclass, with extensions you may be able to add it to Number
or their subtypes in those that where it makes sense and leaving the problematic ones out.