Vector
Definitions
Apply every function from f to every argument from v and return a list with all results.
For f = f1, f2, ... and x = x1, x2, ... the results appear in the order
f1(x1), f1(x2), ..., f2(x1), f2(x2), ....
Return a new vector, appending the elements v2 after elements of v1.
Perform a binary search for x on the sorted vector v and returns the position of x.
Returns None if v does not contain x. Otherwise returns Some(i),
where Vector.get(i, v) == x.
Assumes v is sorted. If this is not the case the result is undefined.
If v contains multiple x-values then the index of one of them will be returned.
Compares a and b lexicographically.
Returns the number of elements in v that satisfy the predicate f.
Returns a copy of vector v, dropping the first n elements.
Returns an empty vector if n > length(v).
Returns a copy of vector v, dropping the last n elements.
Returns an empty vector if n > length(v).
Returns copy of vector v without the longest prefix that satisfies the predicate f.
Returns copy of vector v without the longest suffix that satisfies the predicate f.
Returns true if vectors a and b have the same elements in the same order, i.e. are structurally equal.
Returns true if and only if at least one element in v satisfies the predicate f.
Returns false if v is empty.
Returns a vector of every element in v that satisfies the predicate f.
Collects the successful results of applying the partial function f to every element in v.
Alias for findIndexOfLeft.
Optionally returns the position of the first element in v satisfying f.
Optionally returns the position of the first element in v satisfying f
searching from right to left.
Returns the positions of the all the elements in v satisfying f.
Optionally returns the first element of v that satisfies the predicate f when searching from left to right.
Returns the first non-None result of applying the partial function f to each element of v.
Returns None if every element of xs is None.
Optionally returns the first element of v that satisfies the predicate f when searching from right to left.
Returns the result of applying f to every element in v and concatenating the results.
Returns the concatenation of all the vectors in the vector vs.
Returns the result of applying combine to all the elements in v, using empty as the initial value.
Alias for foldLeft2.
Applies f to a start value s and all elements in v going from left to right.
That is, the result is of the form: f(...f(f(s, a[0]), a[1])..., xn).
Accumulates the result of applying f pairwise to the elements of a and b
starting with the initial value c and going from left to right.
Returns the result of mapping each element and combining the results.
Applies f to a start value s and all elements in v going from right to left.
That is, the result is of the form: f(a[0], ...f(a[n-1], f(a[n], s))...).
Accumulates the result of applying f pairwise to the elements of a and b
starting with the initial value c and going from right to left.
Returns true if and only if all elements in v satisfy the predicate f.
Returns true if v is empty.
Apply the effectful function f to all the elements in the vector v.
Apply the effectful function f to all the elements in the vector v.
Partitions v into subvectors such that for any two elements x and y in a subvector,
if f(x) and f(y) are equal according to Eq on b.
A subvector is created by iterating through the remaining elements of v from left to right and adding an
element to the subvector if and only if doing so creates no conflicts with the elements already in the subvector.
Partitions v into subvectors such that for any two elements x and y in a subvector, f(x, y) is true.
A subvector is created by iterating through the remaining elements of v from left to right and adding an
element to the subvector if and only if doing so creates no conflicts with the elements already in the subvector.
The function f must be pure and define an equivalence relation.
Returns Some(x) if x is the first element of v.
Returns None if v is empty.
Optionally returns the position of the first occurrence of a in v
searching from left to right.
Optionally returns the position of the first occurrence of a in v
searching from right to left.
Returns a range of all valid indices of the vector v.
Return the positions of the all the occurrences of a in v.
Build an vector of length len by applying f to the successive indices.
Returns the concatenation of the elements in vs with the elements
of sep inserted between every two adjacent elements.
Returns a copy of v with sep inserted between every two adjacent elements.
Returns true if and only if a is an infix of b.
Returns true if and only if a is a prefix of b.
Returns true if and only if a is a suffix of b.
Returns the concatenation of the string representation
of each element in v with sep inserted between each element.
Returns the concatenation of the string representation
of each element in v according to f with sep inserted between each element.
Returns Some(x) if x is the last element of v.
Returns None if v is empty.
Returns the result of applying f to every element in v.
The result is a new vector.
Returns the result of applying f to every element in v along with that element's index.
That is, the result is of the form: [ f(0, a[0]), f(1, a[1]), ... ].
Optionally finds the largest element of v according to the Order on v.
Returns None if v is empty.
Optionally finds the largest element of v according to the given comparator cmp.
Returns None if v is empty.
Returns true if and only if v contains the element x.
Optionally finds the smallest element of v according to the Order on v.
Returns None if v is empty.
Optionally finds the smallest element of v according to the given comparator cmp.
Returns None if v is empty.
Optionally returns the element at position i in the vector v.
Returns a pair of vectors (v1, v2).
v1 contains all elements of v that satisfy the predicate f.
v2 contains all elements of v that do not satisfy the predicate f.
Returns b with the n elements starting at index i replaced with the elements of a.
If any of the indices i, i+1, i+2, ... , i+n-1 are out of range in b then no patching is done at these indices.
If a becomes depleted then no further patching is done.
If patching occurs at index i+j in b, then the element at index j in a is used.
Returns a vector of all integers between b (inclusive) and e (exclusive).
Returns an empty vector if b >= e.
Applies f to all elements in v going from left to right until a single value v is obtained. Returns Some(v).
Returns None if v is empty.
Applies f to all elements in v going from right to left until a single value v is obtained. Returns Some(v).
Returns None if v is empty.
Returns v without adjacent duplicates according to their Eq instance.
The first occurence in a chain of duplicates is kept.
Returns v without adjacent duplicates according to the function f.
Elements x and y are duplicates if and only if f(x, y) = true.
The first occurence in a chain of duplicates is kept.
f must define an equivalence relation on the elements of the list.
Returns a vector with the element x repeated n times.
Returns an empty vector if n <= 0.
Returns a copy of v with every occurrence of src replaced by dst.
Rotate the contents of vector v by n steps to the left.
Rotate the contents of vector v by n steps to the right.
Accumulates the result of applying f to v going left to right.
That is, the result is of the form: [s , f(s, x1), f(f(s, x1), x2), ...].
Accumulates the result of applying f to xs going right to left.
That is, the result is of the form: [..., f(xn-1, f(xn, s)), f(xn, s), s].
def sequence(v: Vector[m[a]]): m[Vector[a]] with Applicative[m]§ SourceReturns the result of running all the actions in the list v going from left
to right.
Returns a fresh array with the elements from the vector v from index b (inclusive) until index e (exclusive).
Returns a sorted copy of vector v, where the elements are ordered from low to high according to
their Order instance.
The sort is not stable, i.e., equal elements may appear in a different order than in the input v.
The sort implementation is a Quicksort.
Returns a sorted copy of vector v, where the elements are ordered from low to high according to
the Order instance for the values obtained by applying f to each element.
The sort is not stable, i.e., equal elements may appear in a different order than in the input v.
The sort implementation is a Quicksort.
Returns a sorted copy of vector v, where the elements are ordered from low to high according to
the comparison function cmp.
The sort is not stable, i.e., equal elements may appear in a different order than in the input v.
The sort implementation is a Quicksort.
Returns a pair of vectors (v1, v2).
v1 is the longest prefix of v that satisfies the predicate f.
v2 is the remainder of v.
Split the vector v at the position n returning the left and right parts.
Position n is included in the right part.
Example: splitAt(2, Vector#{1, 2, 3, 4}) returns (Vector#{1, 2}, Vector#{3, 4})
Returns (v, Vector#{}) if n > length(xs).
Returns (Vector#{}, v) if n < 0.
Returns the sum of all elements in the vector v according to the function f.
Returns a fresh vector taking first n elements of v.
Returns a copy of v if n > length(v).
Returns a fresh vector taking last n elements of v.
Returns a copy v if n > length(v).
Returns the longest prefix of v that satisfies the predicate f.
Returns the longest suffix of v that satisfies the predicate f.
Returns the association vector v as a map.
If v contains multiple mappings with the same key, toMap does not
make any guarantees about which mapping will be in the resulting map.
Optionally returns the vector v as a non-empty chain.
If v is empty return None, otherwise return the Nec wrapped in Some.
Optionally returns the vector v as a non-empty list.
If v is empty return None, otherwise return the Nel wrapped in Some.
Returns a string representation of the given vector v.
Returns the transpose of vs.
Returns a non-transposed copy of vs if the dimensions of the elements of vs are mismatched.
def traverse(f: a -> m[b] \ ef, v: Vector[a]): m[Vector[b]] \ ef with Applicative[m]§ SourceReturns the result of applying the applicative mapping function f to all the elements of the
vector v going from left to right.
Returns a pair of vectors, the first containing all first components in v
and the second containing all second components in v.
Returns a copy of v with the element at index i replaced by x.
Returns a copy of v if i < 0 or i > length(xs)-1.
Returns a copy of v with the elements starting at index i replaced by sub.
Returns a vector where the element at index i is (x, y) where
x is the element at index i in a and y is the element at index i in b.
If either a or b becomes depleted, then no further elements are added to the resulting vector.
Returns a vector where the element at index i is f(x, y) where
x is the element at index i in a and y is the element at index i in b.
If either a or b becomes depleted, then no further elements are added to the resulting vector.
def zipWithA(f: a -> (b -> m[c] \ ef), v1: Vector[a], v2: Vector[b]): m[Vector[c]] \ ef with Applicative[m]§ SourceGeneralize zipWith to an applicative functor f.