Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- argmax
- Find the index of the maximum element.
- argmin
- Find the index of the minimum element.
- build_
vec_ env - Build Vec type in the environment.
- flatten_
once - Flatten one level of nesting.
- group_
by - Group consecutive elements by a key function.
- indexed_
map - Map over a slice and collect the results, also returning the original indices.
- is_
palindrome - Return
trueifvis a palindrome. - register_
vec_ extended_ axioms - Register all extended Vec axioms into
env. - run_
length_ decode - Decode a run-length encoded sequence back to a flat vector.
- run_
length_ encode - Run-length encode a slice: consecutive equal elements become
(value, count). - same_
length_ check - Assert that two slices have the same length and return an error otherwise.
- vec_
append - Concatenate two vectors into a new one.
- vec_
cartesian_ product - Produce all combinations of one element from each inner slice.
- vec_
chunks - Split a slice into chunks of
size. - vec_
contains - Return
trueifvcontainselem. - vec_
count_ where - Count elements matching a predicate.
- vec_
dedup_ stable - Deduplicate a vector (keeping first occurrence), preserving order.
- vec_
difference - Return elements in
anot inb(order-preserving,O(n*m)). - vec_
drop - Drop the first
nelements. - vec_
drop_ while - Drop elements while a predicate is true.
- vec_
ext_ build_ ap_ composition Vec.ap_composition : ap (ap (ap [∘] fs) gs) xs = ap fs (ap gs xs)- vec_
ext_ build_ ap_ homomorphism Vec.ap_homomorphism : ap [f] [v] = [f v]- vec_
ext_ build_ ap_ identity Vec.ap_identity : ap [id] xs = xs- vec_
ext_ build_ ap_ interchange Vec.ap_interchange : ap fs [v] = ap [fun f => f v] fs- vec_
ext_ build_ append_ assoc Vec.append_assoc : (xs ++ ys) ++ zs = xs ++ (ys ++ zs)- vec_
ext_ build_ append_ nil_ left Vec.append_nil_left : [] ++ xs = xs- vec_
ext_ build_ append_ nil_ right Vec.append_nil_right : xs ++ [] = xs- vec_
ext_ build_ chunks_ all_ size Vec.chunks_all_size : ∀ chunk ∈ init (chunks n xs), length chunk = n- vec_
ext_ build_ chunks_ count Vec.chunks_count : length (chunks n xs) = ceil (length xs / n)- vec_
ext_ build_ chunks_ flatten Vec.chunks_flatten : flatten (chunks n xs) = xs(when n > 0)- vec_
ext_ build_ concat_ map_ assoc Vec.concat_map_assoc : concatMap (concatMap f ∘ g) = concatMap f ∘ concatMap g- vec_
ext_ build_ concat_ map_ id Vec.concat_map_id : concatMap pure xs = xs- vec_
ext_ build_ dlist_ append_ assoc Vec.dlist_append_assoc : dlist append is associative- vec_
ext_ build_ dlist_ to_ list Vec.dlist_to_list_preserves : toList (dlist d) = d []- vec_
ext_ build_ drop_ length Vec.drop_length : length (drop n xs) = max 0 (length xs - n)- vec_
ext_ build_ fenwick_ correct Vec.fenwick_prefix_sum_correct : query fenwick i = sum (take (i+1) original)- vec_
ext_ build_ filter_ fusion Vec.filter_fusion : filter p (filter q xs) = filter (fun x => p x && q x) xs- vec_
ext_ build_ fin_ index_ get Vec.fin_index_get : ∀ {α n} (xs : Vec α n) (i : Fin n), xs[i] is within bounds- vec_
ext_ build_ fin_ index_ set Vec.fin_index_set : ∀ {α n} (xs : Vec α n) (i : Fin n) v, set xs i v has same length- vec_
ext_ build_ fin_ map_ length Vec.fin_map_preserves_length : length (map f xs) = length xs- vec_
ext_ build_ flatten_ map Vec.flatten_map : flatten (map (map f) xss) = map f (flatten xss)- vec_
ext_ build_ flatten_ singleton Vec.flatten_singleton : flatten [[x1], [x2], ...] = [x1, x2, ...]- vec_
ext_ build_ fold_ build_ duality Vec.fold_build_duality : foldr f z (build g) = g f z(deforestation)- vec_
ext_ build_ foldl_ cons Vec.foldl_cons : foldl f z (x::xs) = foldl f (f z x) xs- vec_
ext_ build_ foldl_ foldr_ duality Vec.foldl_foldr_duality : foldl f z xs = foldr (flip f) z (reverse xs)- vec_
ext_ build_ foldl_ nil Vec.foldl_nil : foldl f z [] = z- vec_
ext_ build_ foldr_ cons Vec.foldr_cons : foldr f z (x::xs) = f x (foldr f z xs)- vec_
ext_ build_ foldr_ nil Vec.foldr_nil : foldr f z [] = z- vec_
ext_ build_ functor_ map_ comp Vec.functor_map_comp : ∀ α β γ (f : α → β) (g : β → γ), map (g ∘ f) = map g ∘ map f- vec_
ext_ build_ functor_ map_ id Vec.functor_map_id : ∀ α, map id xs = xs- vec_
ext_ build_ groupby_ flatten Vec.groupBy_flatten : flatten (groupBy eq xs) = xs- vec_
ext_ build_ length_ append Vec.length_append : length (xs ++ ys) = length xs + length ys- vec_
ext_ build_ map_ filter_ fusion Vec.map_filter_fusion : map f (filter p xs) = filterMap (fun x => if p x then Some (f x) else None) xs- vec_
ext_ build_ map_ fusion Vec.map_fusion : map f (map g xs) = map (f ∘ g) xs- vec_
ext_ build_ matrix_ col_ count Vec.matrix_col_count : length (head (transpose m)) = length m- vec_
ext_ build_ matrix_ row_ count Vec.matrix_row_count : length (transpose m) = length (head m)- vec_
ext_ build_ matrix_ transpose_ invol Vec.matrix_transpose_involutive : transpose (transpose m) = m- vec_
ext_ build_ monad_ assoc Vec.monad_assoc : ∀ α β γ, andThen (andThen xs f) g = andThen xs (fun x => andThen (f x) g)- vec_
ext_ build_ monad_ left_ id Vec.monad_left_id : ∀ α β (a : α) (f : α → Vec β), andThen [a] f = f a- vec_
ext_ build_ monad_ right_ id Vec.monad_right_id : ∀ α (xs : Vec α), andThen xs pure = xs- vec_
ext_ build_ parallel_ prefix_ equiv Vec.parallel_prefix_sequential_equiv : parallelPrefix f z xs = scanl f z xs- vec_
ext_ build_ partition_ reconstruct Vec.partition_reconstruct : fst (partition p xs) ++ snd (partition p xs)is permutation- vec_
ext_ build_ prefix_ sum_ correct Vec.prefix_sum_correct : prefixSum xs[i] = sum (take (i+1) xs)- vec_
ext_ build_ reverse_ append Vec.reverse_append : reverse (xs ++ ys) = reverse ys ++ reverse xs- vec_
ext_ build_ reverse_ involutive Vec.reverse_involutive : reverse (reverse xs) = xs- vec_
ext_ build_ reverse_ map Vec.reverse_map : reverse (map f xs) = map f (reverse xs)- vec_
ext_ build_ rle_ length Vec.rle_length : sum (map snd (rle xs)) = length xs- vec_
ext_ build_ rle_ roundtrip Vec.rle_decode_encode : decode (encode xs) = xs- vec_
ext_ build_ rotate_ left_ right_ inv Vec.rotate_left_right_inverse : rotateLeft n (rotateRight n xs) = xs- vec_
ext_ build_ rotate_ length Vec.rotate_length : length (rotateLeft n xs) = length xs- vec_
ext_ build_ rotate_ zero Vec.rotate_zero : rotateLeft 0 xs = xs- vec_
ext_ build_ scanl_ cons Vec.scanl_cons : scanl f z (x::xs) = z :: scanl f (f z x) xs- vec_
ext_ build_ scanl_ last Vec.scanl_last : last (scanl f z xs) = foldl f z xs- vec_
ext_ build_ scanl_ nil Vec.scanl_nil : scanl f z [] = [z]- vec_
ext_ build_ scanr_ cons Vec.scanr_cons : head (scanr f z (x::xs)) = f x (head (scanr f z xs))- vec_
ext_ build_ scanr_ nil Vec.scanr_nil : scanr f z [] = [z]- vec_
ext_ build_ sort_ idempotent Vec.sort_idempotent : sort (sort xs) = sort xs- vec_
ext_ build_ sort_ is_ permutation Vec.sort_is_permutation : sort xs is a permutation of xs- vec_
ext_ build_ sort_ is_ sorted Vec.sort_is_sorted : ∀ α [Ord α] xs, isSorted (sort xs)- vec_
ext_ build_ span_ reconstruct Vec.span_reconstruct : fst (span p xs) ++ snd (span p xs) = xs- vec_
ext_ build_ stable_ sort Vec.stable_sort_preserves_order : stable sort preserves relative order of equal elements- vec_
ext_ build_ take_ drop_ reconstruct Vec.take_drop_reconstruct : take n xs ++ drop n xs = xs- vec_
ext_ build_ take_ length Vec.take_length : length (take n xs) = min n (length xs)- vec_
ext_ build_ unzip_ zip Vec.unzip_zip : unzip (zip xs ys) = (take (min n m) xs, take (min n m) ys)- vec_
ext_ build_ zip_ length Vec.zip_length : length (zip xs ys) = min (length xs) (length ys)- vec_
ext_ build_ zip_ map Vec.zip_map : zip (map f xs) (map g ys) = map (bimap f g) (zip xs ys)- vec_
ext_ forall1_ axiom - Build
∀ (α : Type), Prop. - vec_
ext_ forall2_ axiom - Build
∀ (α β : Type), Prop. - vec_
ext_ forall3_ axiom - Build
∀ (α β γ : Type), Prop. - vec_
ext_ prop_ axiom - vec_
flatten - Flatten a
Vec<Vec<T>>into aVec<T>. - vec_
head - Return the first element of a slice, or
None. - vec_
index_ of - Return the index of the first occurrence of
elem, orNone. - vec_
init - Return all but the last element (i.e.
initof the vector). - vec_
insert_ at - Insert
elematindex, shifting subsequent elements right. - vec_
intersection - Return elements in both
aandb(order-preserving, keeps first occurrence). - vec_
intersperse - Interleave
sepbetween elements ofv. - vec_
is_ subset - Return
trueifais a subset ofb(all elements ofaappear inb). - vec_
last - Return the last element of a slice, or
None. - vec_max
- Return the maximum element of a non-empty slice, or
None. - vec_
mean_ f64 - Compute the arithmetic mean of a
f64slice. - vec_
median_ f64 - Compute the median of a
f64slice. - vec_min
- Return the minimum element of a non-empty slice, or
None. - vec_
normalize_ f64 - Normalise a
f64vector so that its values sum to 1.0. - vec_
partition - Partition into matching and non-matching elements.
- vec_
product_ u64 - Product of all
u64values in a slice. - vec_
remove_ all - Remove all occurrences of
elemfromv. - vec_
remove_ at - Return the vector with element at
indexremoved. - vec_
reverse - Reverse a vector.
- vec_
rotate_ left - Rotate a vector left by
npositions. - vec_
rotate_ right - Rotate a vector right by
npositions. - vec_set
- Replace the element at
indexwithnew_val. - vec_
set_ eq - Return
trueifaandbare set-equal (same elements, any order). - vec_
split_ at - Split a vector at
index, returning(left, right). - vec_
std_ dev_ f64 - Compute the standard deviation (population) of a
f64slice. - vec_
step_ by - Return every
n-th element starting fromstart. - vec_
sum_ u64 - Sum all
u64values in a slice. - vec_
symmetric_ difference - Return elements in either
aorbbut not both (symmetric difference). - vec_
tail - Return all but the first element (i.e.
tailof the vector). - vec_
take - Take up to
nelements from the front of a slice. - vec_
take_ while - Take elements while a predicate is true.
- vec_
transpose - Transpose a
Vec<Vec<T>>(rows ↔ columns). - vec_
try_ map - Map a fallible function over a vector, returning early on error.
- vec_
unzip - Unzip a vector of pairs into two vectors.
- vec_
variance_ f64 - Compute the variance (population) of a
f64slice. - vec_zip
- Zip two vectors into a vector of pairs (up to the shorter length).
- windows_
collect - Sliding window iterator: produce all sub-slices of length
window. - zip_
exact - Zip two slices, failing if they have different lengths.