Keyword.update-exclamation-mark
You're seeing just the function
update-exclamation-mark
, go back to Keyword module for more information.
Specs
Updates the key
with the given function.
If the key
does not exist, raises KeyError
.
If there are duplicated keys, they are all removed and only the first one is updated.
Examples
iex> Keyword.update!([a: 1, b: 2, a: 3], :a, &(&1 * 2))
[a: 2, b: 2]
iex> Keyword.update!([a: 1, b: 2, c: 3], :b, &(&1 * 2))
[a: 1, b: 4, c: 3]
iex> Keyword.update!([a: 1], :b, &(&1 * 2))
** (KeyError) key :b not found in: [a: 1]