keen/col/collection

Source
This is a standard module and does not need to be explicitly imported.
index-too-big record
actual nat64
max-exclusive nat64
== bool(a index-too-big, b index-too-big)
show string(_ index-too-big)
was-locked record (has private fields)
Exception when attempting to mutate a collection that is being iterated
show string(_ was-locked)
iterator-out-of-bounds record (has private fields)
Exception when attempting to skip too far forward or backward
show string(_ iterator-out-of-bounds)
slice-right-to-left record (has private fields)
Exception thrown when trying to slice but the first iterator is to the right of the second iterator.
show string(_ slice-right-to-left)
iterator-not-comparable record (has private fields)
Some iterator operations like slice require two iterators to be for the same collection.
show string(_ iterator-not-comparable)
size[t] spec
size nat64(a t)
some[col, elem] spec
some bool(a col, f bool mut(elem))
some-reverse[col, elem] spec
some-reverse bool(a col, f bool mut(elem))
begin[iter, col] spec
begin iter(a col)
end[iter, col] spec
end iter(a col)
take-prev[elem, iter] spec
take-prev elem(a iter)
take-next[elem, iter] spec
take-next elem(a iter)
peek[elem, iter] spec
peek elem option(a iter)
peek-prev[elem, iter] spec
peek-prev elem option(a iter)
skip-next-n[iter] spec
skip-next-n void(a iter, n nat64)
skip-prev-n[iter] spec
skip-prev-n void(a iter, n nat64)
basic-iter[col, iter, elem] spec col size, (iter, col) begin, iter copy, (elem, iter) take-next
basic-reverse-iter[col, iter, elem] spec col size, (iter, col) end, iter copy, (elem, iter) take-prev
try-take-prev[elem, iter] elem option(a iter) (elem, iter) take-prev
try-take-next[elem, iter] elem option(a iter) (elem, iter) take-next
slice[out, iter] spec
slice out(begin iter, end iter)
slice-out-of-order record (has private fields)
show string(_ slice-out-of-order)
skip-prev[iter] spec
- iter(a iter, n nat64)
skip-next[iter] spec
+ iter(a iter, n nat64)
skip-prev-next[iter] spec iter skip-prev, iter skip-next
index-relative-to-end record
subtract nat64
Represents an index relative to the size of a collection.
end index-relative-to-end()
to-index[col] nat64(a col, index index-relative-to-end) col size
- index-relative-to-end(a index-relative-to-end, n nat64)
index-maybe-relative-to-end union
range-relative-to-end record
.. range-relative-to-end(low nat64, high index-relative-to-end)
.. range-relative-to-end(low index-relative-to-end, high index-relative-to-end)
first[col, elem] elem option(a col) (col, elem) some
first[out, col, elem] out option(a col, f out option mut(elem)) (col, elem) some
Returns the first non-empty result of f.
last[col, elem] elem option(a col) (col, elem) some-reverse
last[out, col, elem] out option(a col, f out option mut(elem)) (col, elem) some-reverse
find[col, elem] elem option(a col, f bool mut(elem)) (col, elem) some
Returns the first element for which f returns true, or an empty option if f always returned false.
find-last[col, elem] elem option(a col, f bool mut(elem)) (col, elem) some-reverse
find-index[col, elem] nat64 option(a col, f bool mut(elem)) (col, elem) some
Returns the first index i for which f[a[i]] is true. Returns an empty option if f returned false for every element of a.
find-last-index[col, elem] nat64 option(a col, f bool mut(elem)) col size, (col, elem) some-reverse
contains[col, elem] bool(xs col, value elem) (col, elem) some, elem equal
index-of[col, elem] nat64 option(a col, search-value elem) (col, elem) some, elem equal
If search-value is in a, return its index.
last-index-of[col, elem] nat64 option(a col, search-value elem) col size, (col, elem) some-reverse, elem equal
every[col, elem] bool(a col, f bool mut(elem)) (col, elem) some

Equivalent to f[a[0]] and f[a[1]] and ... and f[a[end - 1]].

Calls f on each element of a and returns false the fist time f does. Returns true if f returned true every time.

max-by[col, elem, key] elem option(a col, f key mut(elem)) (col, elem) some, key compare
Element with the greatest key.
max-of[col, elem, out] out option(a col, f out mut(elem)) (col, elem) some, out compare
Greatest result of f.
min-by[col, elem, key] elem option(a col, f key mut(elem)) (col, elem) some, key compare
Element with the least key.
min-of[col, elem, out] out option(a col, f out mut(elem)) (col, elem) some, out compare
Least result of f.
from-option[col, elem] col(a elem option) (col, elem) list-new
Empty collection for an empty option; single-element collection for a non-empty option.