Hoogle Search
Within LTS Haskell 24.31 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sortByM :: Monad m => (a -> a -> m Ordering) -> [a] -> m [a]monadlist Control.Monad.ListM No documentation available.
sortM :: (Ord a, Monad m) => [a] -> m [a]monadlist Control.Monad.ListM No documentation available.
sortKey :: NaturalSort a => a -> SortKeynatural-sort Algorithms.NaturalSort Split a sortable type into textual and numeric sections, with no collation transformation. If advanced collation is required, either pre-transform the input (using eg toLower) or use sortKeyCollated.
sortKeyCollated :: NaturalSort a => (Text -> ByteString) -> a -> SortKeynatural-sort Algorithms.NaturalSort Split a sortable type into textual and numeric sections, using a custom collation transformation. This is useful for providing language- or use-specific ordering.
sortElem :: Ord a => [(a, prob)] -> [(a, prob)]probability Numeric.Probability.Distribution No documentation available.
sortP :: Ord prob => [(a, prob)] -> [(a, prob)]probability Numeric.Probability.Distribution No documentation available.
sortPDesc :: Ord prob => [(a, prob)] -> [(a, prob)]probability Numeric.Probability.Distribution No documentation available.
sortBy :: (a -> a -> Ordering) -> [a] -> [a]sort Data.Sort The sortBy function is the non-overloaded version of sort. The argument must be finite. The supplied comparison relation is supposed to be reflexive and antisymmetric, otherwise, e. g., for _ _ -> GT, the ordered list simply does not exist. The relation is also expected to be transitive: if it is not then sortBy might fail to find an ordered permutation, even if it exists.
Examples
>>> sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")] [(1,"Hello"),(2,"world"),(4,"!")]
sortOn :: Ord b => (a -> b) -> [a] -> [a]sort Data.Sort Sort a list by comparing the results of a key function applied to each element. sortOn f is equivalent to sortBy (comparing f), but has the performance advantage of only evaluating f once for each element in the input list. This is called the decorate-sort-undecorate paradigm, or Schwartzian transform. Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input. The argument must be finite.
Examples
>>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")] [(1,"Hello"),(2,"world"),(4,"!")]
>>> sortOn length ["jim", "creed", "pam", "michael", "dwight", "kevin"] ["jim","pam","creed","kevin","dwight","michael"]
Performance notes
This function minimises the projections performed, by materialising the projections in an intermediate list. For trivial projections, you should prefer using sortBy with comparing, for example:>>> sortBy (comparing fst) [(3, 1), (2, 2), (1, 3)] [(1,3),(2,2),(3,1)]
Or, for the exact same API as sortOn, you can use `sortBy . comparing`:>>> (sortBy . comparing) fst [(3, 1), (2, 2), (1, 3)] [(1,3),(2,2),(3,1)]
sortBy :: Configuration -> Stringsphinx Text.Search.Sphinx Attribute to sort by