val season: String, val value: Int) val scores = listOf( ScoresRecord("Alice", "ֶ", "21্ظ", 100), ScoresRecord("Alice", "ӳޠ", "21্ظ", 100), ScoresRecord("Bob", "ֶ", "21্ظ", 100), ScoresRecord("Bob", "ӳޠ", "21্ظ", 100), … ) value class PositiveInt(val value: Int) { fun plus(other: PositiveInt) = PositiveInt(this.value + other.value) } val scoresPerNameKamoku = scores.groupMapReduce( { Pair(it.name, it.kamoku) }, // keyTransform: (T) -> K { PositiveInt(it.value) }, // valueTransform: (T) -> V { a1, a2 -> a1.plus(a2) } // valueReduce: (V, V) -> (V) )