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.
sort2ByOffset :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> Int -> m ()vector-algorithms Data.Vector.Algorithms.Optimal Sorts the elements at the positions off and 'off + 1' in the given array using the comparison.
-
vector-algorithms Data.Vector.Algorithms.Optimal Sorts the elements at the three given indices. The indices are assumed to be given from lowest to highest, so if 'l < m < u' then 'sort3ByIndex cmp a m l u' essentially sorts the median of three into the lowest position in the array.
sort3ByOffset :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> Int -> m ()vector-algorithms Data.Vector.Algorithms.Optimal Sorts the three elements starting at the given offset in the array.
-
vector-algorithms Data.Vector.Algorithms.Optimal Sorts the elements at the four given indices. Like the 2 and 3 element versions, this assumes that the indices are given in increasing order, so it can be used to sort medians into particular positions and so on.
sort4ByOffset :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> Int -> m ()vector-algorithms Data.Vector.Algorithms.Optimal Sorts the four elements beginning at the offset.
sortBy :: (PrimMonad m, MVector v e) => Int -> Int -> (Int -> e -> Int) -> v (PrimState m) e -> m ()vector-algorithms Data.Vector.Algorithms.Radix Radix sorts an array using custom radix information requires the number of passes to fully sort the array, the size of of auxiliary arrays necessary (should be one greater than the maximum value returned by the radix function), and a radix function, which takes the pass and an element, and returns the relevant radix.
sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()vector-algorithms Data.Vector.Algorithms.Tim Sorts an array using a custom comparison.
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)vector-algorithms Data.Vector.Algorithms.Tim A variant on sort that returns a vector of unique elements.
-
vector-algorithms Data.Vector.Algorithms.Tim A variant on sortBy which returns a vector of unique elements.
sortBy :: SemiSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seqmono-traversable Data.Sequences Sort a sequence using an supplied element ordering function.
> let compare' x y = case compare x y of LT -> GT; EQ -> EQ; GT -> LT > sortBy compare' [5,3,6,1,2,4] [6,5,4,3,2,1]