The sorting vocabulary implements the merge-sort algorithm. It runs in O(n log n) time, and is a stable sort, meaning that the order of equal elements is preserved.
The algorithm only allocates two additional arrays, both the size of the input sequence, and uses iteration rather than recursion, and thus is suitable for sorting large sequences.
Sorting combinators take comparator quotations with stack effect ( elt1 elt2 -- <=> ), where the output value is one of the three Ordering specifiers.