sortBy
https://hackage.haskell.org/package/base-4.19.0.0/docs/Data-List.html#v:sortBy
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
code:hs
>> sortBy (\(a,_) (b,_) -> compare a b)
(2, "world"), (4, "!"), (1, "Hello")
(1,"Hello"),(2,"world"),(4,"!")