replace method
Returns a copy of this map where the value of key
is set to newValue
if already present.
Returns the map unchanged if key
is not present.
Implementation
ImmortalMap<K, V> replace(K key, V newValue) =>
lookup(key).map((value) => add(key, newValue)).orElse(this);