Tuple.insert_at
You're seeing just the function
insert_at
, go back to Tuple module for more information.
Specs
insert_at(tuple(), non_neg_integer(), term()) :: tuple()
Inserts an element into a tuple.
Inserts value
into tuple
at the given index
.
Raises an ArgumentError
if index
is negative or greater than the
length of tuple
. Index is zero-based.
Inlined by the compiler.
Examples
iex> tuple = {:bar, :baz}
iex> Tuple.insert_at(tuple, 0, :foo)
{:foo, :bar, :baz}
iex> Tuple.insert_at(tuple, 2, :bong)
{:bar, :baz, :bong}