Hoogle Search
Within LTS Haskell 24.34 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sortBy :: forall ty (n :: Nat) . (ty -> ty -> Ordering) -> Vect n ty -> Vect n tybasement Basement.Sized.Vect No documentation available.
sortBy :: (Char -> Char -> Ordering) -> String -> Stringbasement Basement.String Sort the character in a String using a specific sort function TODO: optimise not going through a list
sortBy :: PrimType ty => (ty -> ty -> Ordering) -> UArray ty -> UArray tybasement Basement.UArray No documentation available.
-
yi-core Yi.Buffer.HighLevel Sort the lines of the region.
sortLinesWithRegion :: Region -> BufferM ()yi-core Yi.Buffer.HighLevel No documentation available.
-
yi-core Yi.Config.Simple Sort the lines of the region.
sortLinesWithRegion :: Region -> BufferM ()yi-core Yi.Config.Simple No documentation available.
sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty abase-compat-batteries Data.List.NonEmpty.Compat sortOn :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty abase-compat-batteries Data.List.NonEmpty.Compat Sort a NonEmpty on a user-supplied projection of its elements. See sortOn for more detailed information.
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)]
sortWith is an alias for `sortBy . comparing`.sortWith :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty abase-compat-batteries Data.List.NonEmpty.Compat sortWith for NonEmpty, behaves the same as:
sortBy . comparing