sortBy package:rio is:exact

The sortBy function is the non-overloaded version of sort.
>>> sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")]
[(1,"Hello"),(2,"world"),(4,"!")]
sortBy for NonEmpty, behaves the same as sortBy
sortBy sorts the specified Seq according to the specified comparator. The sort is stable. If stability is not required, unstableSortBy can be slightly faster.