Map.replace-exclamation-mark

You're seeing just the function replace-exclamation-mark, go back to Map module for more information.
Link to this function

replace!(map, key, value)

View Source (since 1.5.0)

Specs

replace!(map(), key(), value()) :: map()

Puts a value under key only if the key already exists in map.

If key is not present in map, a KeyError exception is raised.

Inlined by the compiler.

Examples

iex> Map.replace!(%{a: 1, b: 2}, :a, 3)
%{a: 3, b: 2}

iex> Map.replace!(%{a: 1}, :b, 2)
** (KeyError) key :b not found in: %{a: 1}