keen/col/sort

Source
This is a standard module and does not need to be explicitly imported.
is-sorted[col, elem] bool(a col) (col, elem) some, elem compare
is-sorted[col, elem, key] bool(a col, f key data(elem)) (col, elem) some, key compare
sort[col, elem] col(a col) (col, elem) list-new, (col, elem) some, col size, elem compare
Sorts the elements from least to greatest. The result satisfies res[i] <= res[i + 1].
sort[col, elem, k] col(a col, get-key k mut(elem)) (col, elem) list-new, (col, elem) some, col size, k compare
Sorts the elements comparing by the result of get-key.
sort-unique[col, elem] col(a col) (col, elem) list-new, (col, elem) some, col size, elem compare
Sorts and remove duplicates. That means res[i] < res[i + 1] for each element in the result.
sort-unique[col, elem, k] col(a col, get-key k data(elem)) (col, elem) list-new, (col, elem) some, col size, k compare
sort-in-place[t] void(a t buffer-view) t compare
Sorts in-place from least to greatest.
sort=[t, k] void(a t mut[], get-key k mut(t)) k compare
sort=[t, k] void(a t buffer-view, get-key k mut(t)) k compare
sort-by-first[t, u] (t[], u[])(a t[], b u[]) t compare
Sort a, and move elements of b in the same permutation as a. This is useful if a and b are parallel arrays, meaning a[i] and b[i] belong together for the same i. Every pair a[i] and b[i], will move to res.a[j] and res.b[j] for some j.