(++) [Pvec] | v ++ u is append v u .
|
A | |
add_first [Pvec] | add_first e v is singleton e ++ v .
|
add_last [Pvec] | add_last v e is v ++ singleton e .
|
append [Pvec] | append v u is the vector resulting from appending u to v .
|
B | |
break_left [Pvec] | break_left n v is (take_left n v, drop_left n v) .
|
break_right [Pvec] | break_right n v is (drop_right n v, take_right n v) .
|
C | |
chunk_left [Pvec] | chunk_left size v is v , in order, chunked into vectors
of exactly size elements except maybe for the last one.
|
chunk_right [Pvec] | chunk_right size v is v , in order, chunked into vectors
of exactly size elements except maybe for the first one.
|
compare [Pvec] | compare ~cmp u v is the lexicographic order betwen u and v
using cmp to compare elements.
|
concat [Pvec] | concat ~sep vs is the concatenation of the vectors of vs , separated
by sep (defaults to Pvec.empty ):
vs.(0) ++ sep ++ vs.(2) ++ ...
|
concat_list [Pvec] | concat_list ~sep vs is concat ~sep (of_list vs) .
|
cut_left [Pvec] | cut_left sep v is either the pair Some (l, r) of the two
(possibly empty) vectors of v that are delimited by the first
match of the non empty separator vector sep or None if sep
can't be matched in v .
|
cut_right [Pvec] | cut_right sep v is like Pvec.cut_right but matching starts on the right.
|
cuts_left [Pvec] | cuts_left ~drop_empty ~sep v is the vector of subvectors of v that
are delimited by matches of the non empty separator vector sep .
|
cuts_right [Pvec] | cuts_right ~drop_empty ~sep v is like Pvec.cuts_left but matching
starts from the right.
|
D | |
drop_left [Pvec] | drop_left n v has the elements of v without the first n elements.
|
drop_right [Pvec] | drop_right n v has the elements of v without the last n elements.
|
dump [Pvec] | dump pp_v ppf v prints an unspecified representation of v on ppf
using pp_v to print the elements.
|
E | |
edit_distance [Pvec] | edit_distance ~eq u v is the number of single element edits
(insertion, deletion, substitution) that are needed to change
u into v .
|
el [Pvec] | el v i is the element v.(i) , if any; in particular this is
None on i < 0 .
|
empty [Pvec] | empty is the empty vector.
|
equal [Pvec] | equal ~eq u v is true iff u and v have the same length
and for all indices i of u , eq u.(0) v.(1) .
|
exists [Pvec] | exists p is true iff there exists an index i of v with p
v.(i) = true .
|
F | |
fields [Pvec] | fields ~drop_empty ~is_sep v is the vector of (possibly empty)
subvectors that are delimited by elements for which is_sep is true .
|
fill [Pvec] | fill ~pad u i e is:
set u i e if i is a valid index of u ., set (u ++ (v len:(i + 1 - length v) pad)) i e otherwise.
|
fill_first [Pvec] | fill_first v e is set v 0 e or singleton e if v is empty.
|
fill_last [Pvec] | fill_last v e is set v (length v - 1) e or singleton e if
v is empty.
|
filter [Pvec] | filter sat v is fst (partition sat v) .
|
filter_map [Pvec] | filter_map f s is filter_mapi (fun _ e -> f e) v .
|
filter_mapi [Pvec] | filter_map f s is the vector made of the elements of v as
(and if) mapped by f , in the same order.
|
first_el [Pvec] | first_el v is el v 0 .
|
fold_left [Pvec] | fold_left f acc v is foldi_left (fun acc _ e -> f acc) acc v .
|
fold_right [Pvec] | fold_right f v acc is foldi_right (fun _ e acc -> f acc) v acc .
|
foldi_left [Pvec] | foldi_left f acc v is f (... (f (f acc 0 v.(0)) 1 v.(1)) ...) m s.(m)
with m = length v - 1 or acc if v is empty.
|
foldi_right [Pvec] | fold_right f v acc is f 0 v.(0) (f 1 v.(1) (... (f m v.(m) acc) ..))
with m = length v - 1 or acc if v is empty.
|
for_all [Pvec] | for_all p v is true iff for all indices i of v , p v.(i) = true .
|
G | |
get [Pvec] | get v i is v.(i) .
|
get_first [Pvec] | get_first v is get v 0 .
|
get_last [Pvec] | get_last v is get v (length v - 1) .
|
I | |
indices [Pvec] | indices v is mapi (fun i _ -> i) .
|
init [Pvec] | init ~len f is a vector v of length len with v.(i) = f i for
all valid indices i of v .
|
ints [Pvec] | ints n is the sequence of integers from start (defaults to
0 ) to n (included).
|
is_empty [Pvec] | is_empty v is true iff length v = 0 .
|
is_filled [Pvec] | is_filled v i is true iff v.(i) exists.
|
is_infix [Pvec] | is_infix ~eq ~affix v is true iff affix can be found in v
that is iff there exists an index j in v such that for all
valid indices i of affix , eq affix.(i) v.(j + i) =
true .
|
is_prefix [Pvec] | is_prefix ~eq ~affix v is true iff affix is a prefix of v
that is iff eq affix.(i) v.(i) = true for all valid indices
i of affix .
|
is_suffix [Pvec] | is_suffix ~eq ~affix v is true iff affix is a suffix of v
that is iff eq affix.(n - i) v.(m - i) = true for all indices
i of affix with n = length affix - 1 and m = last_index
v .
|
iter_left [Pvec] | iter_left f v is iteri_left (fun _ e -> f e) v .
|
iter_right [Pvec] | iter_right f v is iteri_right (fun _ e -> f e) v .
|
iteri_left [Pvec] | iteri_left f v is f 0 v.(0); f 1 v.(1); ...; f m v.(m) with
m = length v - 1 or () if v is empty.
|
iteri_right [Pvec] | iteri_right f v is f m v.(m); f (m-1) v.(m-1); ...; f 0 v.(0) with
m = length v - 1 or () if v is empty.
|
K | |
keep_left [Pvec] | keep_left sat v has the first consecutive sat satisfying
elements of v .
|
keep_right [Pvec] | keep_right sat v has the last consecutive sat satisfying
elements of v .
|
L | |
last_el [Pvec] | last_el v is el v (length v - 1) .
|
left_find [Pvec] | left_find ~start sat v is Some (i, v.(i)) with i the
smallest index i , if any, greater or equal to start such that
sat v.(i) is true .
|
length [Pvec] | length v is the number of elements in v .
|
lose_left [Pvec] | lose_left sat v has the elements of v without the first
consecutive sat satisfying elements of v .
|
lose_right [Pvec] | lose_right sat v has the elements of v without the last
consecutive sat satisfying elements of v .
|
M | |
map [Pvec] | map f v is mapi (fun _ e -> f e) v .
|
mapi [Pvec] | mapi f v is u with u.(i) = f i v.(i) for all indices i of
v or the empty vector if v is empty.
|
max_length [Pvec] | max_length is the maximal vector length.
|
O | |
of_array [Pvec] | of_array a is a as a persistent vector.
|
of_bytes [Pvec] | of_bytes bytes is bytes as a persistent vector.
|
of_list [Pvec] | of_list l is l as a persistent vector.
|
of_string [Pvec] | of_string s is s as a persistent vector.
|
P | |
partition [Pvec] | partition sat v is a pair of vectors (vt, vf) with
vt the elements that satisfy sat and vf the elements
that do not.
|
pop_first [Pvec] | pop_first v is Some (get_first v, drop_left 1 v) or None
if v is empty.
|
pop_last [Pvec] | pop_last v is Some (drop_right 1 v, get_last v) or None
if v is empty.
|
pp [Pvec] | pp ~sep pp_v ppf v formats v 's elements.
|
pp_chars [Pvec] | pp_chars is pp ~sep:(fun _ _ -> ()) Format.pp_print_char .
|
R | |
range [Pvec] | range ~first ~last v is u defined as the consecutive elements
of v whose indices exist in the range [first ;last ], in the
same order.
|
rem [Pvec] | rem v i is rem_range ~first:i ~last:i v .
|
rem_first [Pvec] | rem_first v is rem v 0 .
|
rem_last [Pvec] | rem_last v is rem v (length v - 1) .
|
rem_range [Pvec] | rem_range ~first ~last v is v without the elements of v
that exist in the range [first ;last ].
|
rev [Pvec] | rev v is u the vector with elements of v reversed, u.(i) =
v.(length v - 1 - i) for all indices i of v or the empty
vector if v is empty.
|
right_find [Pvec] | right_find ~start sat v is Some (i, v.(i)) with i the
greatest index i , if any, smaller or equal to start such that
sat v.(i) is true .
|
S | |
set [Pvec] | set v i e is v with the element at index i equal to e .
|
set_first [Pvec] | set_first v e is set v 0 e .
|
set_last [Pvec] | set_last v e is set v (length v - 1) e .
|
shuffle [Pvec] | shuffle rand v is a random permutation of v 's elements.
|
singleton [Pvec] | singleton e is v ~len:1 e .
|
sort_uniq [Pvec] | sort_uniq compare v is like Pvec.stable_sort except duplicates
are removed.
|
span_left [Pvec] | span_left sat v is (keep_left sat v, lose_left sat v) .
|
span_right [Pvec] | span_right sat v is (lose_right sat v, keep_right sat v) .
|
splice [Pvec] | splice ~into ~first ~last v replaces the elements of into in
range [first ; last ] with those of v or inserts v at
first if the range is empty.
|
stable_sort [Pvec] | stable_sort compare v is v with its elements sorted according to
compare .
|
suggest [Pvec] | suggest ~dist candidates v are the elements of candidates
whose Pvec.edit_distance is the smallest to s and at most
at distance dist of s (defaults to 2 ).
|
T | |
take_left [Pvec] | take_left n v has the first n elements of v .
|
take_right [Pvec] | take_right n v has the last n elements of v .
|
to_array [Pvec] | to_array v is v as an array.
|
to_bytes [Pvec] | to_string v is v as bytes
|
to_list [Pvec] | to_list v is v as a list.
|
to_string [Pvec] | to_string v is v as a string.
|
transpose [Pvec] | transpose v is u such that u.(i).(j) = v.(j).(i) for all
indices i of v and j of its subvectors.
|
trim [Pvec] | trim drop v is lose_right drop (lose_left drop v) .
|
U | |
unstutter [Pvec] | unstutter ~eq v is v without consecutive equal elements.
|
V | |
v [Pvec] | v len e is a vector u of length len with u.(i) = e for all
valid indices i of u .
|