creates a new vector from l, whose length is length l and
with the i(th) element of l used as the i(th) element of the
vector. If the length of the list is greater than maxLen, then the
Size exception is raised.
creates a vector of n elements, where the elements
are defined in order of increasing index by applying f to the
element's index. This is equivalent to the expression (fromList
(List.tabulate (n, f))). If n < 0 or maxLen < n, then the Size
exception is raised.
returns the vector that is the concatenation of the vectors
in the list l. If the total length of these vectors exceeds maxLen,
then the Size exception is raised.
These apply the function f to the elements of a vector in
left to right order (i.e., in order of increasing indices). The more
general appi function supplies both the element and the element's
index to the function f. These are respectively equivalent to:
List.app f (foldri (fn (i,a,l) => (i,a)::l) [] vec)
List.app f (foldr (fn (a,l) => a::l) [] vec)
These functions produce new vectors by mapping the
function f from left to right over the argument vector. The more
general form mapi supplies f with the vector index of an element along
with the element. These are respectively equivalent to:
fromList (List.map f (foldri (fn (i,a,l) => (i,a)::l) [] vec))
fromList (List.map f (foldr (fn (a,l) => a::l) [] vec))
These fold the function f over all the elements of
a vector, using the value init as the initial value. The functions
foldli and foldl apply the function f from left to right (increasing
indices), while the functions foldri and foldr work from right to left
(decreasing indices). The more general functions foldli and foldri
supply both the element and the element's index to the function f.
See the MONO_ARRAY manual pages for reference implementations of the
indexed versions. The last two expressions are respectively equivalent
to:
foldli (fn (_, a, x) => f(a, x)) init vec
foldri (fn (_, a, x) => f(a, x)) init vec
These apply f to each element of the vector vec, from
left to right (i.e., increasing indices), until a true value is
returned. If this occurs, the functions return the element; otherwise,
they return NONE. The more general version findi also supplies f with
the vector index of the element and, upon finding an entry satisfying
the predicate, returns that index with the element.
applies f to each element x of the vector vec, from
left to right (i.e., increasing indices), until f(x) evaluates to
true; it returns true if such an x exists and false otherwise.
applies f to each element x of the vector vec, from left
to right (i.e., increasing indices), until f(x) evaluates to false; it
returns false if such an x exists and true otherwise. It is equivalent
to not(exists (not o f ) vec)).