Skip to main content

Module array

Module array 

Source
Expand description

Lean’s Array: a growable sequence of objects, updated in place when nothing else refers to it.

As in lean.h: an argument named a that a function changes is consumed, indexes and arrays that are only read are borrowed, stored values are consumed, and results are owned unless the function’s name ends in borrowed.

Functions§

array_fget⚠
array_fget_borrowed⚠
array_fset⚠
array_fswap⚠
array_get⚠
array_get_borrowed⚠
The element at i. Lean’s arr[i]!: an index outside the array is a panic.
array_get_size⚠
array_mark_linear⚠
Lean’s debugging aid for finding accidental copies of an array. The mark has no effect on values, and this runtime does not track it.
array_mk⚠
An array from a List, which it consumes.
array_pop⚠
Removes the last element, if there is one.
array_propagate_mark⚠
See array_mark_linear. Returns target.
array_push⚠
array_set⚠
Lean’s arr.set! i v: an index outside the array is a panic.
array_size⚠
array_swap⚠
Swaps two elements; does nothing if an index is outside the array.
array_to_list⚠
The elements as a List. Consumes a.
array_uget⚠
array_uget_borrowed⚠
array_uset⚠
array_uswap⚠
elements⚠
The elements of an array.
from_vec
A new array that owns items.
into_vec⚠
The elements of an array nothing else refers to, with the references it held. Gives up the array.
mk_array⚠
An array of n references to value. Consumes both.
mk_empty_array_with_capacity⚠