std:collections/Array
std:collections/Array
Section titled “std:collections/Array”Canonical occurrence:
protos/lib/collections/Array.protos· Protos revision:e99b712ecf658a527b1fe82c8beba2c1286d8dc9.
Sequential and isolated-parallel algorithms over ordinary Arrays.
Observable top-level slots
Section titled “Observable top-level slots”This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.
filter
Section titled “filter”Answers a fresh Array of the elements of a snapshot of array for which
predicate(element) answers true, keeping source order. A result other
than canonical true or false signals InvalidPredicateResult.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,predicate -
Rest parameter: none
-
Source occurrence:
protos/lib/collections/Array.protos:34 -
Exact source page: open in the source browser
findIndex
Section titled “findIndex”Answers the lowest index of a snapshot of array whose element satisfies
predicate(element), or null when none does. Elements are tested in
ascending order; a result other than canonical true or false signals
InvalidPredicateResult.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,predicate -
Rest parameter: none
-
Source occurrence:
protos/lib/collections/Array.protos:79 -
Exact source page: open in the source browser
Answers a fresh Array whose element i is transform(array[i]), applied to a
snapshot of array in ascending index order.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,transform -
Rest parameter: none
-
Source occurrence:
protos/lib/collections/Array.protos:20 -
Exact source page: open in the source browser
parallelFilter
Section titled “parallelFilter”Answers a Future of a fresh Array of the elements for which
predicate(element, arguments...), evaluated in isolated parallel
execution, answers true. Selection keeps source order. Outcomes are
examined in ascending index order, so the lowest index whose predicate
fails or answers something other than canonical true or false
(InvalidPredicateResult) supplies the failure.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,predicate -
Rest parameter:
arguments -
Source occurrence:
protos/lib/collections/Array.protos:312 -
Exact source page: open in the source browser
parallelFindIndex
Section titled “parallelFindIndex”Answers a Future of the lowest index whose element satisfies
predicate(element, arguments...), evaluated in isolated parallel
execution, or null when none does. Indexes are decided in ascending
logical order: a failure or non-Boolean result (InvalidPredicateResult)
at a lower index defeats a later match, and work at higher indexes is
cancelled once the outcome is decided.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,predicate -
Rest parameter:
arguments -
Source occurrence:
protos/lib/collections/Array.protos:356 -
Exact source page: open in the source browser
parallelMap
Section titled “parallelMap”Answers a Future of a fresh Array whose element i is
worker(array[i], arguments...), evaluated in isolated parallel execution.
Results keep source order; the lowest failing index supplies the failure.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,worker -
Rest parameter:
arguments -
Source occurrence:
protos/lib/collections/Array.protos:273 -
Exact source page: open in the source browser
parallelReduce
Section titled “parallelReduce”Answers a Future of the reduction of the elements with
reducer(left, right, arguments...), or null for an empty Array. Each
round combines adjacent pairs (0,1), (2,3), … left to right in isolated
parallel execution and carries an odd final value unchanged, so the
parenthesization is fixed and a non-associative reducer stays
deterministic. Within a round the leftmost failing pair supplies the
failure, and no later round starts after a failure.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,reducer -
Rest parameter:
arguments -
Source occurrence:
protos/lib/collections/Array.protos:398 -
Exact source page: open in the source browser
parallelSort
Section titled “parallelSort”Answers a Future of a fresh Array with the elements stably sorted by
less(left, right, arguments...). The result, comparator invocation order,
and failures are exactly those of sort with the comparator
(left, right) => less(left, right, arguments...), except that every
comparator invocation runs in its own isolated parallel execution. The
source Array is not mutated.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,less -
Rest parameter:
arguments -
Source occurrence:
protos/lib/collections/Array.protos:467 -
Exact source page: open in the source browser
reduce
Section titled “reduce”Folds a snapshot of array left to right with reducer(accumulator, element).
An optional single initial value seeds the fold; without one, the first
element does, and an empty Array answers null. More than one initial
value signals an Error.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,reducer -
Rest parameter:
initial -
Source occurrence:
protos/lib/collections/Array.protos:103 -
Exact source page: open in the source browser
Answers a fresh Array with the elements of a snapshot of array stably sorted
by less(left, right). A comparator result other than canonical true or
false signals InvalidComparatorResult, and two elements each less than
the other signal InvalidComparatorOrder. The source is not mutated.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
array,less -
Rest parameter: none
-
Source occurrence:
protos/lib/collections/Array.protos:147 -
Exact source page: open in the source browser
Exact module source · Standard-library API · Standard library overview