Just checking - I don't think this exists in the s...
# stdlib
r
Just checking - I don't think this exists in the stdlib?
Copy code
fun <K, V> Iterable<Pair<K, V>>.groupByKey(): Map<K, List<V>> = this.groupBy({ it.first }, { it.second})
Is it a bad idea?
e
if we had something like a
Copy code
interface Multimap<K, V> : Map<K, List<V>>
then this method would could naturally be called
.toMultimap()
👍 1