Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sort :: ListLike full item => full -> fullListLike Data.ListLike Sorts the list. On data types that do not preserve ordering, or enforce their own ordering, the result may not be what you expect. See also sortBy.
sort :: ListLike full item => full -> fullListLike Data.ListLike.Base Sorts the list. On data types that do not preserve ordering, or enforce their own ordering, the result may not be what you expect. See also sortBy.
-
basic-prelude BasicPrelude The sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function. Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input. The argument must be finite.
Examples
>>> sort [1,6,4,3,2,5] [1,2,3,4,5,6]
>>> sort "haskell" "aehklls"
>>> import Data.Semigroup(Arg(..)) >>> sort [Arg ":)" 0, Arg ":D" 0, Arg ":)" 1, Arg ":3" 0, Arg ":D" 1] [Arg ":)" 0,Arg ":)" 1,Arg ":3" 0,Arg ":D" 0,Arg ":D" 1]
-
dhall Dhall.Map Sort the keys of a Map, forgetting the original ordering
sort (sort x) = sort x
>>> sort (fromList [("B",1),("A",2)]) fromList [("A",2),("B",1)]
sort :: Ord a => Set a -> Set adhall Dhall.Set Sort the set elements, forgetting their original ordering.
>>> sort (fromList [2, 1]) == fromList [1, 2] True
-
mongoDB Database.MongoDB.Query Sort results by this order, [] = no sort. Default = []
sort :: Ord a => NESeq a -> NESeq anonempty-containers Data.Sequence.NonEmpty sort sorts the specified NESeq by the natural ordering of its elements. The sort is stable. If stability is not required, unstableSort can be slightly faster.
-
prelude-compat Data.List2010 No documentation available.
sort :: (Functor io, MonadIO io, Ord a) => Shell a -> io [a]turtle Turtle.Prelude Return a list of the sorted elements of the given Shell, keeping duplicates:
>>> sort (select [1,4,2,3,3,7]) [1,2,3,3,4,7]
-
data-ordlist Data.List.Ordered The sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function. Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input. The argument must be finite.
Examples
>>> sort [1,6,4,3,2,5] [1,2,3,4,5,6]
>>> sort "haskell" "aehklls"
>>> import Data.Semigroup(Arg(..)) >>> sort [Arg ":)" 0, Arg ":D" 0, Arg ":)" 1, Arg ":3" 0, Arg ":D" 1] [Arg ":)" 0,Arg ":)" 1,Arg ":3" 0,Arg ":D" 0,Arg ":D" 1]