[Haskell-cafe] version sorting?

Francesco Ariis fa-ml at ariis.it
Sat Dec 8 10:38:15 UTC 2018


Hello Jarvan,

On Fri, Dec 07, 2018 at 05:47:44PM -0800, Javran Cheng wrote:
> I'm wondering if there's any existing packages that do "version sorting":
> as an example, for a list like:

    https://hackage.haskell.org/package/natural-sort

    λ> :m +Algorithms.NaturalSort
    λ> :m +Data.List
    λ> sortBy (Algorithms.NaturalSort.compare) ["foo-10.20", "foo-1.2", "foo-2.100", "foo-1.12"]
    ["foo-1.2","foo-1.12","foo-2.100","foo-10.20"]




More information about the Haskell-Cafe mailing list