Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sortIids :: (ItemId -> ItemFull) -> [(ItemId, ItemQuant)] -> [(ItemId, ItemQuant)]LambdaHack Game.LambdaHack.Common.Item No documentation available.
-
LambdaHack Game.LambdaHack.Common.Level No documentation available.
sortBy :: (a -> a -> Ordering) -> [a] -> [a]LambdaHack Game.LambdaHack.Core.Prelude 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]LambdaHack Game.LambdaHack.Core.Prelude 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)]
sortPoint :: (Point, Point) -> (Point, Point)LambdaHack Game.LambdaHack.Server.DungeonGen.AreaRnd Sort the sequence of two points, in the derived lexicographic order.
sortOn :: Ord b => (a -> b) -> [a] -> [a]List Data.List.Class No documentation available.
sortBy :: (a -> a -> Ordering) -> [a] -> [a]cabal-install-solver Distribution.Solver.Compat.Prelude 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,"!")]
sortBy :: (a -> a -> Ordering) -> PSQ k a -> PSQ k acabal-install-solver Distribution.Solver.Modular.PSQ No documentation available.
sortByKeys :: (k -> k -> Ordering) -> PSQ k a -> PSQ k acabal-install-solver Distribution.Solver.Modular.PSQ No documentation available.
sortGoals :: (Variable QPN -> Variable QPN -> Ordering) -> EndoTreeTrav d ccabal-install-solver Distribution.Solver.Modular.Preference Sort all goals using the provided function.