Equations
Make an empty vector with pre-allocated capacity.
Equations
Instances For
Make an empty vector with pre-allocated capacity.
Equations
Instances For
Makes a vector of size n
with all cells containing v
.
Equations
Instances For
Equations
Instances For
Returns a vector of size 1
with element v
.
Equations
Instances For
Set an element in a vector using a Nat
index, with a tactic provided proof that the index is in
bounds.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Set an element in a vector using a Nat
index. Returns the vector unchanged if the index is out of
bounds.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Set an element in a vector using a Nat
index. Panics if the index is out of bounds.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Extracts the slice of a vector from indices start
to stop
(exclusive). If start ≥ stop
, the
result is empty. If stop
is greater than the size of the vector, the size is used instead.
Equations
Instances For
Extract the first i
elements of a vector. If i
is greater than or equal to the size of the
vector then the vector is returned unchanged.
We immediately simplify this to the extract
operation, so there is no verification API for this function.
Equations
Instances For
Deletes the first i
elements of a vector. If i
is greater than or equal to the size of the
vector then the empty vector is returned.
We immediately simplify this to the extract
operation, so there is no verification API for this function.
Equations
Instances For
Shrinks a vector to the first m
elements, by repeatedly popping the last element.
We immediately simplify this to the extract
operation, so there is no verification API for this function.
Equations
Instances For
Maps elements of a vector using the function f
,
which also receives the index of the element, and the fact that the index is less than the size of the vector.
Equations
Instances For
Equations
Instances For
See also Vector.ofFnM
defined in Init.Data.Vector.OfFn
.
Swap two elements of a vector using Fin
indices.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Swap two elements of a vector using Nat
indices. Panics if either index is out of bounds.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Swaps an element of a vector with a given value using a Fin
index. The original value is returned
along with the updated vector.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
Swaps an element of a vector with a given value using a Nat
index. Panics if the index is out of
bounds. The original value is returned along with the updated vector.
This will perform the update destructively provided that the vector has a reference count of 1.
Equations
Instances For
The vector #v[0, 1, 2, ..., n-1]
.
Equations
Instances For
Delete the first element of a vector. Returns the empty vector if the input vector is empty.
We immediately simplify this to the extract
operation, so there is no verification API for this function.
Equations
Instances For
ForIn instance #
Equations
ForM instance #
ToStream instance #
Lexicographic ordering #
Lexicographic comparator for vectors.
lex v w lt
is true if
v
is pairwise equivalent via==
tow
, or- there is an index
i
such thatlt v[i] w[i]
, and for allj < i
,v[j] == w[j]
.