Leon K
02/19/2020, 2:47 PM/** 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
?)spand
02/20/2020, 8:35 AMmergeAll
or simply an overloaded merge
?Leon K
02/20/2020, 11:26 AM