diff --git a/core/src/main/kotlin/org/nwapw/abacus/number/NumberUtils.kt b/core/src/main/kotlin/org/nwapw/abacus/number/NumberUtils.kt new file mode 100644 index 0000000..5503613 --- /dev/null +++ b/core/src/main/kotlin/org/nwapw/abacus/number/NumberUtils.kt @@ -0,0 +1,10 @@ +@file:JvmName("NumberUtils") +package org.nwapw.abacus.number + +typealias PromotionFunction = java.util.function.Function +typealias PromotionPath = List +typealias NumberClass = Class + +fun PromotionPath.promote(from: NumberInterface): NumberInterface { + return fold(from, { current, function -> function.apply(current) }) +} \ No newline at end of file