pop method

Option<(V, Map<K, V>)> pop(
  1. Eq<K> eq,
  2. K key
)

Delete a key and value from a this Map, returning the deleted value as well as the updated Map.

If key is not present, then return None.

See also deleteAt.

Implementation

Option<(V, Map<K, V>)> pop(Eq<K> eq, K key) => lookupEq(eq, key).map(
      (v) => (v, deleteAt(eq, key)),
    );