sortBy -base +containers

sortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
containers Data.Sequence
O(n log n). sortBy sorts the specified Seq according to the specified comparator. The sort is stable. If stability is not required, unstableSortBy can be considerably faster, and in particular uses less memory.
unstableSortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
containers Data.Sequence
O(n log n). A generalization of unstableSort, unstableSortBy takes an arbitrary comparator and sorts the specified sequence. The sort is not stable. This algorithm is frequently faster and uses less memory than sortBy, and performs extremely well -- frequently twice as fast as sortBy -- when the sequence is already nearly sorted.