RosettaCodeData/Task/Sort-numbers-lexicographically/Haskell/sort-numbers-lexicographically-1.hs

7 lines
142 B
Haskell
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import Data.List (sort)
task :: (Ord b, Show b) => [b] -> [b]
task = map snd . sort . map (\i -> (show i, i))
main = print $ task [1 .. 13]