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.

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

    rio RIO.List

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

  2. sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a

    rio RIO.NonEmpty

    sortBy for NonEmpty, behaves the same as sortBy

  3. sortWith :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a

    rio RIO.NonEmpty

    sortWith for NonEmpty, behaves the same as:

    sortBy . comparing
    

  4. sortBy :: (a -> a -> Ordering) -> Seq a -> Seq a

    rio RIO.Seq

    sortBy sorts the specified Seq according to the specified comparator. The sort is stable. If stability is not required, unstableSortBy can be slightly faster.

  5. sortBy :: Vector v e => Comparison e -> v e -> v e

    statistics Statistics.Function

    Sort a vector using a custom ordering.

  6. sortCRL :: CRL -> IO ()

    HsOpenSSL OpenSSL.X509.Revocation

    sortCRL crl sorts the certificates in the revocation list.

  7. sortedConvexHull :: OrderedField n => [P2 n] -> ([P2 n], [P2 n])

    diagrams-lib Diagrams.TwoD.Points

    Find the convex hull of a set of points already sorted in the x direction. The first list of the tuple is the upper hull going clockwise from left-most to right-most point. The second is the lower hull from right-most to left-most in the anti-clockwise direction.

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

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  9. sortAlpha :: SortOpts -> Bool

    hedis Database.Redis

    No documentation available.

  10. sortBy :: SortOpts -> Maybe ByteString

    hedis Database.Redis

    No documentation available.

Page 21 of many | Previous | Next