MutList
Definitions
Appends m to v i.e. inserts all elements from m into the end of v.
Compresses the given mutable list v if needed.
The mutable list will be shrunk to 1/2 of its size if the load factor is less than 1/4.
Returns a shallow copy of the given mutable list v.
The capacity of the copy is equal to the length of the list.
Returns the number of elements in the given mutable list v that satisfies the given predicate f.
Returns 0 if the given mutable list v is empty.
Returns an empty mutable list with a default capacity.
Returns an empty mutable list with the given capacity rounded up to the default capacity.
Returns true if the given predicate f holds for at least one element of the given mutable list v.
Returns false if the given mutable list v is empty.
Optionally returns the left-most element in the given mutable list v that satisfies the given predicate f.
Returns None if no element satisfies the given predicate f.
Returns None if the given mutable list v is empty.
Optionally returns the right-most element in the given mutable list v that satisfies the given predicate f.
Returns None if no element satisfies the given predicate f.
Returns None if the given mutable list v is empty.
def flatMap(rc1: Region[r1], f: a -> MutList[b, r1] \ ef, v: MutList[a, r]): MutList[b, r1] \ ef + r + r1§ SourceApply f to every element in v and concatenate the results.
The result is a new mutable list.
Concatenates all the contained MutLists.
Applies f to a start value s and all elements in a going from left to right.
That is, the result is of the form: f(...f(f(s, a[0]), a[1])..., xn).
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], s)...).
The implementation is tail recursive.
Returns true if the given predicate f holds for all elements of the given mutable list v.
Returns true if the given mutable list v is empty.
Applies f to all the elements in v.
Applies f to all the elements in v along with that element's index.
Retrieves the value at position i in the mutable list v.
Throws IndexOutOfBoundsException if the index is out of bounds.
Optionally returns the first element of the given mutable list v.
Returns None if the given mutable list v is empty.
Optionally returns the position of the first occurrence of x in v
searching from left to right.
Optionally returns the position of the first occurrence of x in v
searching from right to left.
Returns a range of all valid indices of the mutable list v.
Returns the positions of all occurrences of x in v.
Inserts the given element x at the given position i in the given mutable list v.
Shifts elements as necessary. Possibly expensive operation.
If the given index i exceeds the length of the mutable list, the element is inserted at the last position.
Build a mutable list by applying f to the initial value x.
f should return Some(a1) to signal a new element a1 (which also becomes the next input to f).
f should return None to signal the end of building the list.
Returns an iterator over l.
Modifying l while using an iterator has undefined behavior and is dangerous.
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.
Optionally returns the last element of the given mutable list v.
Returns None if the given mutable list v is empty.
Returns the number of elements in the given mutable list v.
Apply f to every element in v.
def mapWithIndex(rc1: Region[r1], f: Int32 -> (a -> b \ ef), v: MutList[a, r]): MutList[b, r1] \ ef + r + r1§ SourceReturns the result of applying f to every element in v along with that element's index.
Optionally finds the largest element of v according to the Order on a.
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 the given element x is a member of the given mutable list v.
Optionally finds the smallest element of v according to the Order on a.
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.
Returns true if the given mutable list v is non-empty.
Optionally returns the element at position i in the mutable list v.
Optionally removes and returns the last element in the given mutable list v.
Inserts the given element x at the end of the given mutable list v.
Appends m to v i.e. inserts all elements from m into the end of v.
Stores the value x at position i in the mutable list v.
Throws IndexOutOfBoundsException if the index is out of bounds.
Returns a mutable list of all integers between b (inclusive) and e (exclusive).
Returns an empty mutable list 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.
Removes the element at the given position i in the given mutable list v.
Shifts elements as necessary. Possibly expensive operation.
If the given index i exceeds the length of the mutable list, no element is removed.
Replaces all occurrences of the src with dst in the given mutable list v.
Increases the capacity of the given mutable list v by at least n.
That is, after the call, the mutable list is guaranteed to have space for at least n additional elements.
The content of the mutable list is unchanged.
Removes all elements from the given mutable list v that do not satisfy the given predicate f.
Reverses the order of the elements in the given mutable list v.
Returns true if the mutable lists v1 and v2 have the same elements in the same order, i.e. are structurally equal.
def scan(rc1: Region[r1], f: b -> (a -> b \ ef), s: b, v: MutList[a, r2]): MutList[b, r1] \ ef + r2 + r1§ SourceAlias for scanLeft.
def scanLeft(rc1: Region[r1], f: b -> (a -> b \ ef), s: b, v: MutList[a, r2]): MutList[b, r1] \ ef + r2 + r1§ SourceAccumulates the result of applying f to v going left to right.
def scanRight(rc1: Region[r1], f: a -> (b -> b \ ef), s: b, v: MutList[a, r2]): MutList[b, r1] \ ef + r2 + r1§ SourceAccumulates the result of applying f to v going right to left.
Shuffles v using the Fisher–Yates shuffle.
Returns the number of elements in the given mutable list v.
Sort MutList v so that elements are ordered from low to high according to their Order instance.
The MutList is mutated in-place.
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.
Sort MutList v so that elements are ordered from low to high according to the Order instance for
the values obtained by applying f to each element. The MutList is mutated in-place.
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.
Sort MutList v so that elements are ordered from low to high according to the comparison function cmp.
The MutList is mutated in-place.
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 the sum of all elements in the MutList v according to the function f.
Returns v as an array.
Returns a string representation of the given MutList l.
Apply f to every element in v along with that element's index.
Truncates the given mutable list v to the given length l.
That is, after the operation, the mutable list has length at most l.
If the given length l is negative, all elements are removed.
Build a mutable list by applying f to the seed value st.
f should return Some(a, st1) to signal a new element a and a new seed value st1.
f should return None to signal the end of building the list.
Build a mutable list by applying the function next to (). next is expected to encapsulate
a stateful resource such as a file handle that can be iterated.
next should return Some(a) to signal a new element a.
next should return None to signal the end of building the list.