def isort_by

bend-mathlib@0.8.1.0 · perm.bend:75

import bend-mathlib@0.8.1.0/perm.bend as Perm
import Base

75# Insertion sort by the comparator le.
76def isort_by(~A: Data, ~le: A -> A -> Bool, xs: List<&2, A>) -> List<&2, A>:
77  match xs:
78    case Nil{}:
79      Nil{}
80    case +x <> t:
81      insert_by(~A, ~le, x, isort_by(~A, ~le, t))

Uses (3)

Used by (4)