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.
sortFitsIn :: MonadConversion m => Sort -> Sort -> m ()Agda Agda.TypeChecking.Sort No documentation available.
sortOf :: (PureTCM m, MonadBlock m, MonadConstraint m) => Term -> m SortAgda Agda.TypeChecking.Sort Reconstruct the sort of a term. Precondition: given term is a well-sorted type.
sortOfType :: (PureTCM m, MonadBlock m, MonadConstraint m) => Type -> m SortAgda Agda.TypeChecking.Sort Reconstruct the minimal sort of a type (ignoring the sort annotation).
sorted :: Ord a => [a] -> BoolAgda Agda.Utils.List Check whether a list is sorted. O(n). Assumes that the Ord instance implements a partial order.
sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty aAgda Agda.Utils.List1 sortOn :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty aAgda Agda.Utils.List1 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 aAgda Agda.Utils.List1 sortWith for NonEmpty, behaves the same as:
sortBy . comparing
sortPair :: Ord a => (a, a) -> (a, a)Agda Agda.Utils.Tuple Order a pair.
sortRulesByPrecedence :: [Rule] -> [(Integer, Rule)]BNFC BNFC.CF Sort rules by descending precedence.
sort2B :: (IfB a, OrdB a) => (a, a) -> (a, a)Boolean Data.Boolean