// A sort that keeps the order of the elements it calls equal. Swift's `sort`// is not stable, and an order that leans on "as read" for its ties (the order// a store answered in, `created_at`) would otherwise shuffle equal rows on// every read.extensionArray {/// Sort, keeping the order of elements the comparator calls equal.////// `areInIncreasingOrder` must be a STRICT ordering (`<`, never `<=`), as/// `sorted(by:)` requires; ties fall through to the original index.func stableSorted(by areInIncreasingOrder: (Element, Element) -> Bool) -> [Element] { enumerated() .sorted { left, right inif areInIncreasingOrder(left.element, right.element) { returntrue }if areInIncreasingOrder(right.element, left.element) { returnfalse }return left.offset < right.offset } .map(\.element) }}