Lists: their length (arr.count, arr.isEmpty), what a write makes of
one (arr.append, and arr.include and arr.exclude over a set held as a
sorted list of scalars), and the questions a Rows node asks of each
element (any, every, count with a test, sum, min, max, find,
keep).
You write a fold's test as an arrow, called once while the expression is
built with a path for the element: Arr.any(state.todos, todo =>
todo.completed). What is kept is the expression it returns, its reads of
the element bound to the fold, so every reader sees the test as nodes. A
null list gives null; a test that gives null does not pass.
arr.append(list, element): the list with the element at the end. Called
as arr.append(list, fields, ...values) the element is the record of
those fields to those values, each field a [name, option] pair: where
option is true the element's Schema holds it as an Effect Option, which
takes the value as some and null as none. A null list gives null; a null
element is appended as it is, since a list may hold null.
The element of list at index, counted from 0: null where the list holds
none there (a negative index, or one past the end), and refused for an
index that is not a safe integer. Arr.at(state.board, input.cell). Over a
tuple a literal index reads that position, typed as it is.
arr.at(list, index): the element at index of list, counted from 0,
read as a path reads one (an Option element is its value or null); null
where the list holds no element there (a negative index or one past the
end), where either operand is null, or where the element is null.
A body built from build, called once with a path for an element whose
Schema is element, bound to binder. The path refuses to be used once
build has returned, so no read of the element escapes its body. A body
holds no opaque term, so every reader sees all it asks.
The index a list operand takes: a number expression, null, or a number;
for a tuple with no rest a literal must be one of its positions, so
Arr.at(line, 3) over three positions does not compile.
What Arr.at(list, index) reads: at positions of a tuple the index names
by its type (a literal, or a literal union Schema.Literals([0, 1, 2])),
those positions' types; otherwise any element's, or null.
arr.move(list, keyField, keyValue, toIndex): move every element whose
elem[keyField] equals keyValue (an Option field reads as its value) as
one block, in their order, to toIndex of the list without them (clamped to
[0, rest.length]). Returns list unchanged (preserving identity) when no
element matches or the block is already there, so move is idempotent.
Fold value over the elements of list that pass test using a declared
commutative-monoid operation op: returns op's identity over no elements
and skips null contributions.
The total of value over the elements that pass test (every one
without it): 0 over none; a null value adds nothing; an integer total
past ±(2^53−1) is refused.
What Arr.with(list, index, value) and Transition.setAt take as the
value: for a list, an element; for a tuple, a value every position the
index may name takes (the named ones, or all of them for a computed index).
list with its element at index replaced by value: the list a
Transition.setAt of the same three leaves, for a guard or a rule over the
state after it. Refused where index names no element of the list, or is
not a safe integer; null where the list or the index is. Over a tuple the
value must fit every position the index may name.
arr.with(list, index, value): the list with its element at index
replaced by value (which may be null: a list may hold one), the list
itself where that element is value already. Null where the list or the
index is; refused where the index names no element of the list, since no
element is there to replace.