keen/col/sort
SourceThis is a standard module
and does not need to be explicitly imported.
sort[col, elem, k] col(a col, get-key k mut(elem)) (col, elem) list-new, (col, elem) some, col size, k compareSorts 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 compareSorts 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 comparesort-by-first[t, u] (t[], u[])(a t[], b u[]) t compareSort
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.
res[i] <= res[i + 1].