I want to kown that is some way to create a map where each key has more that one value in the idiomatic way
Someone knows how create a map, where each key has more that one value?
for simplify the process of do this:
I don’t think there’s a way to do it without calling an extra function… since to is an infix function and as far as I understand, infix functions only ever take one argument on the right hand side. Otherwise you could do something like:
infix fun <K, V> K.to(vararg values: V): Pair<K, List<V>> = this to values.toList()