A.Vector.replace_at-exclamation-mark

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

replace_at!(vector, index, value)

View Source

Specs

replace_at!(t(val), index(), val) :: t(val) when val: value()

Returns a copy of vector with a replaced value at the specified index.

Raises an A.Vector.IndexError if index is out of bounds. Supports negative indexing from the end of the vector.

Runs in effective constant time.

Examples

iex> A.Vector.new(1..8) |> A.Vector.replace_at!(5, :foo)
vec([1, 2, 3, 4, 5, :foo, 7, 8])
iex> A.Vector.new(1..8) |> A.Vector.replace_at!(-2, :foo)
vec([1, 2, 3, 4, 5, 6, :foo, 8])
iex> A.Vector.new(1..8) |> A.Vector.replace_at!(8, :foo)
** (A.Vector.IndexError) out of bound index: 8 not in -8..7