def sort_by_perm

bend-mathlib@0.8.1.0 · perm.bend:245

import bend-mathlib@0.8.1.0/perm.bend as Perm
import Base
import bendlib-kernel-list@1.0.0.0/list.bend as K

245# The sort permutes its input.
246def sort_by_perm(~A: Data, ~le: A -> A -> Bool, +xs: List<&2, A>) -> K.perm(A, xs, sort_by(~A, ~le, xs)):
247  msort_by_perm(~A, ~le, List.length(&2, A, xs), xs)

Uses (6)

Used by (1)