small proposal that seemingly does not exist yet: ...
# stdlib
l
small proposal that seemingly does not exist yet:
Copy code
/** merge another map into this map,
 * storing the result of applying the given remapping function to the two values if there is a key-conflict. */
fun <K, V> MutableMap<K, V>.putAllWith(other: Map<K, V>, remappingFn: (V, V) -> V) = other.forEach { (k, v) ->
    merge(k, v, remappingFn)
}
any maybe a matching
plus
-like operation (
unionWith
?)
s
Wouldnt a better name be
mergeAll
or simply an overloaded
merge
?
l
possibly yes, you're right