This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 1.0.1
Natural ordering, human-friendly sorting
version 1.0.2
license BSD-3-Clause
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.2
Committed At 2018-01-15 19:26:17 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

README

NaturalOrdering is an Elm-package for human-friendly sorting of lists.

Build Status

import Html exposing (div, h3, li, text, ul)
import NaturalOrdering

main =
let
    data =
    [ "4-banana"
    , "12-apple"
    , "1-orange"
    , "2-bananb"
    ]

    defaultSort =
    List.sort data

    naturalSort =
    NaturalOrdering.sort data
in
div []
    [ h3 [] [ text "Default Sort" ]
    , ul [] <| List.map (\txt -> li [] [ text txt ]) defaultSort
    , h3 [] [ text "Natural Sort" ]
    , ul [] <| List.map (\txt -> li [] [ text txt ]) naturalSort
    ]

The snippet above will output

# Default Sort

* 1-orange
* 12-apple
* 2-bananb
* 4-banana

# Natural Sort

* 1-orange
* 2-bananb
* 4-banana
* 12-apple

Run this example in your browser.