Array α
is the type of dynamic arrays
with elements from α
. This type has special support in the runtime.
An array has a size and a capacity; the size is Array.size
but the capacity
is not observable from Lean code. Arrays perform best when unshared; as long
as they are used "linearly" all updates will be performed destructively on the
array, so it has comparable performance to mutable arrays in imperative
programming languages.
From the point of view of proofs Array α
is just a wrapper around List α
.
Constructor
Array.mk.{u} |
Converts a
You can also use the synonym
At runtime, this constructor is implemented by |
Fields
toList | : | List α |
Converts a
At runtime, this projection is implemented by |