def sort_by
import bend-mathlib@0.8.1.0/perm.bend as Permimport Base
241# Merge sort by the comparator le.
242def sort_by(~A: Data, ~le: A -> A -> Bool, +xs: List<&2, A>) -> List<&2, A>:
243 msort_by(~A, ~le, List.length(&2, A, xs), xs)
import bend-mathlib@0.8.1.0/perm.bend as Permimport Base
241# Merge sort by the comparator le.
242def sort_by(~A: Data, ~le: A -> A -> Bool, +xs: List<&2, A>) -> List<&2, A>:
243 msort_by(~A, ~le, List.length(&2, A, xs), xs)