Perm.isort_by: def of bend-mathlib@0.8.1.0 Import: import bend-mathlib@0.8.1.0/perm.bend as Perm Lines 75-81 of bend-mathlib@0.8.1.0/perm.bend: https://jend.leeeet.dev/read.txt?path=bend-mathlib@0.8.1.0/perm.bend&start_line=75&end_line=81 import Base # Insertion sort by the comparator le. def isort_by(~A: Data, ~le: A -> A -> Bool, xs: List<&2, A>) -> List<&2, A>: match xs: case Nil{}: Nil{} case +x <> t: insert_by(~A, ~le, x, isort_by(~A, ~le, t)) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=bend-mathlib@0.8.1.0/perm.bend&name=insert_by