@@ -20,6 +20,9 @@ list must have the same type.
21# Special Folds
21# Special Folds
22@docs sum, product, maximum, minimum, all, any, and, or
22@docs sum, product, maximum, minimum, all, any, and, or
25+@docs sort, sortBy, sortWith
25import open Basics
28import open Basics
@@ -224,3 +227,16 @@ drop = Native.List.drop
225repeat : Int -> a -> [a]
228repeat : Int -> a -> [a]
226repeat = Native.List.repeat
229repeat = Native.List.repeat
231+{-| Sort a list in ascending order. -}
232+sort : [comparable] -> [comparable]
233+sort = Native.List.sort
235+{-| Sort a list by a given comparison transformation, such a [record field
236+accessors](http://elm-lang.org/learn/Syntax.elm#records). -}
237+sortBy : (a -> comparable) -> [a] -> [a]
238+sortBy = Native.List.sortBy
240+{-| Sort a list by a given comparison function. -}
241+sortWith : (a -> a -> Order) -> [a] -> [a]
242+sortWith = Native.List.sortWith