modifyAt method
If the given key
is present in the Map, then modify its value
using modify
and return a the new Map.
Otherwise, return None.
Implementation
Option<Map<K, V>> Function(K key, V Function(V value)) modifyAt(Eq<K> eq) =>
(K key, V Function(V value) modify) => member(key)
? some(
map(
(k, v) =>
eq.eqv(k, key) ? MapEntry(key, modify(v)) : MapEntry(k, v),
),
)
: none();