def sort
import bend-lint-api@0.2.0.0/shared/lists.bend as Listsimport Base
104# `xs` in `le` order, stable: a bottom-up merge sort.
105def sort(~A: Data, ~le: A -> A -> Bool, xs: List<&2, A>) -> List<&2, A>:
106 +ys = {xs: List<&2, A>}
107 +n = length(&2, A, ys)
108 sort.go(~A, ~le, n, n, sort.runs(A, ys, []))