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.
sortSpecs :: ChartSpec -> Maybe [SortSpec]gogol-sheets Gogol.Sheets.Types The order to sort the chart data by. Only a single sort spec is supported. Only supported for data source charts.
sortSpecs :: DataSourceTable -> Maybe [SortSpec]gogol-sheets Gogol.Sheets.Types Sort specifications in the data source table. The result of the data source table is sorted based on the sort specifications in order.
sortSpecs :: FilterView -> Maybe [SortSpec]gogol-sheets Gogol.Sheets.Types The sort order per column. Later specifications are used when values are equal in the earlier specifications.
sortSpecs :: SortRangeRequest -> Maybe [SortSpec]gogol-sheets Gogol.Sheets.Types The sort order per column. Later specifications are used when values are equal in the earlier specifications.
sortedTrackListForMenu :: MonadDOM m => MediaControlsHost -> TextTrackList -> m [TextTrack]jsaddle-dom JSDOM.Generated.MediaControlsHost Mozilla MediaControlsHost.sortedTrackListForMenu documentation
sortedTrackListForMenuAudio :: MonadDOM m => MediaControlsHost -> AudioTrackList -> m [AudioTrack]jsaddle-dom JSDOM.Generated.MediaControlsHost Mozilla MediaControlsHost.sortedTrackListForMenu documentation
sortedTrackListForMenuAudio_ :: MonadDOM m => MediaControlsHost -> AudioTrackList -> m ()jsaddle-dom JSDOM.Generated.MediaControlsHost Mozilla MediaControlsHost.sortedTrackListForMenu documentation
sortedTrackListForMenu_ :: MonadDOM m => MediaControlsHost -> TextTrackList -> m ()jsaddle-dom JSDOM.Generated.MediaControlsHost Mozilla MediaControlsHost.sortedTrackListForMenu documentation
sortBy :: (a -> a -> Ordering) -> [a] -> [a]listsafe Data.List.Safe 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]listsafe Data.List.Safe 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)]