toople v0.0.1 Toople

Toople wraps Tuple functions

Link to this section Summary

Link to this section Functions

See Tuple.append/2.

Link to this function

delete_at(xA, xB)

See Tuple.delete_at/2.

Link to this function

duplicate(xA, xB)

See Tuple.duplicate/2.

Link to this function

get_at(tuple, index)

get_at(tuple(), non_neg_integer()) :: term()

Gets the element at the zero-based index in tuple.

It raises ArgumentError when index is negative or it is out of range of the tuple elements.

Examples

iex> tuple = {:foo, :bar, 3}
iex> Toople.get_at(tuple, 1)
:bar

iex> Toople.get_at({}, 0)
** (ArgumentError) argument error

iex> Toople.get_at({:foo, :bar}, 2)
** (ArgumentError) argument error
Link to this function

insert_at(xA, xB, xC)

See Tuple.insert_at/3.

Returns the size of a tuple.

## Examples

  iex> Toople.size({:a, :b, :c})
  3

See Tuple.to_list/1.