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.

  1. sortErrors :: Result GQLError a -> Result GQLError a

    morpheus-graphql-core Data.Morpheus.Internal.Ext

    No documentation available.

  2. sortableList :: (MonadHold t m, MonadFix m, Adjustable t m, Ord k) => (k -> v -> m a) -> Map k v -> Event t (v -> v -> Ordering) -> m (Map k a)

    reflex Reflex.Widget.Basic

    Build sortable content in such a way that re-sorting it can cause minimal disruption to an existing context. Naively re-sorting a list of images would destroy every image and add them back in the new order. This framework is able to avoid that by preserving the identity of each image and simply moving it to the new location. Example:

    let sortByFst = buttonA $> comparing fst
    sortBySnd = buttonB $> comparing snd
    sortEvent = leftmost [sortByFst, sortBySnd]
    sortableList
    (\k v -> text $ "\n" ++ show k ++ " " ++ v)  -- show each element on a new line
    (Map.fromList $ zip [0..] [(3, "a"), (2, "b"), (1, "c")])
    sortEvent
    

  3. sortBy :: ListLike full item => (item -> item -> Ordering) -> full -> full

    ListLike Data.ListLike

    Sort function taking a custom comparison function

  4. sortBy :: ListLike full item => (item -> item -> Ordering) -> full -> full

    ListLike Data.ListLike.Base

    Sort function taking a custom comparison function

  5. sortBy :: (a -> a -> Ordering) -> [a] -> [a]

    basic-prelude BasicPrelude

    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,"!")]
    

  6. sortOn :: Ord b => (a -> b) -> [a] -> [a]

    basic-prelude BasicPrelude

    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)]
    

  7. sortWith :: (Ord a, IsSequence c) => (Element c -> a) -> c -> c

    classy-prelude ClassyPrelude

    Sort elements using the user supplied function to project something out of each element. Inspired by http://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Exts.html#v:sortWith.

  8. sortQuantVars :: [Var] -> [Var]

    ghc-lib-parser GHC.Core.Make

    Sort the variables, putting type and covars first, in scoped order, and then other Ids It is a deterministic sort, meaning it doesn't look at the values of Uniques. For explanation why it's important See Note [Unique Determinism] in GHC.Types.Unique.

  9. sORTKind_maybe :: Kind -> Maybe (TypeOrConstraint, Type)

    ghc-lib-parser GHC.Core.Type

    No documentation available.

  10. sortLocatedA :: HasLoc (EpAnn a) => [GenLocated (EpAnn a) e] -> [GenLocated (EpAnn a) e]

    ghc-lib-parser GHC.Parser.Annotation

    No documentation available.

Page 27 of many | Previous | Next