keen/col/collection
SourceThis is a standard module
and does not need to be explicitly imported.
was-locked record (has private fields)Exception when attempting to mutate a collection that is being iterated
iterator-out-of-bounds record (has private fields)Exception when attempting to skip too far forward or backward
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.iterator-not-comparable record (has private fields)Some iterator operations like
slice require two iterators to be for the same collection.size[t] specbegin[iter, col] specbegin iter(a col)end[iter, col] specend iter(a col)take-prev[elem, iter] spectake-prev elem(a iter)take-next[elem, iter] spectake-next elem(a iter)peek[elem, iter] specpeek-prev[elem, iter] specbasic-reverse-iter[col, iter, elem] spec col size, (iter, col) end, iter copy, (elem, iter) take-prevslice[out, iter] specslice out(begin iter, end iter)slice-out-of-order record (has private fields)skip-prev[iter] specskip-next[iter] specindex-maybe-relative-to-end unionfirst[out, col, elem] out option(a col, f out option mut(elem)) (col, elem) someReturns the first non-empty result of
f.find-index[col, elem] nat64 option(a col, f bool mut(elem)) (col, elem) someReturns the first index
i for which f[a[i]] is true. Returns an empty option if f returned false for every element of a.index-of[col, elem] nat64 option(a col, search-value elem) (col, elem) some, elem equalIf
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 equalmax-by[col, elem, key] elem option(a col, f key mut(elem)) (col, elem) some, key compareElement with the greatest key.
max-of[col, elem, out] out option(a col, f out mut(elem)) (col, elem) some, out compareGreatest result of
f.min-by[col, elem, key] elem option(a col, f key mut(elem)) (col, elem) some, key compareElement with the least key.