Сортона Хаскелл
sortOn :: Ord b => (a -> b) -> [a] -> [a]
>>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]
[(1,"Hello"),(2,"world"),(4,"!")]
Captain Bubbles
sortOn :: Ord b => (a -> b) -> [a] -> [a]
>>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]
[(1,"Hello"),(2,"world"),(4,"!")]