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.
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.
sortIndex :: (Ord t, Element t) => Vector t -> Vector Ihmatrix Numeric.LinearAlgebra.Data >>> m <- randn 4 10 >>> disp 2 m 4x10 -0.31 0.41 0.43 -0.19 -0.17 -0.23 -0.17 -1.04 -0.07 -1.24 0.26 0.19 0.14 0.83 -1.54 -0.09 0.37 -0.63 0.71 -0.50 -0.11 -0.10 -1.29 -1.40 -1.04 -0.89 -0.68 0.35 -1.46 1.86 1.04 -0.29 0.19 -0.75 -2.20 -0.01 1.06 0.11 -2.09 -1.58
>>> disp 2 $ m ?? (All, Pos $ sortIndex (m!1)) 4x10 -0.17 -1.04 -1.24 -0.23 0.43 0.41 -0.31 -0.17 -0.07 -0.19 -1.54 -0.63 -0.50 -0.09 0.14 0.19 0.26 0.37 0.71 0.83 -1.04 0.35 1.86 -0.89 -1.29 -0.10 -0.11 -0.68 -1.46 -1.40 -2.20 0.11 -1.58 -0.01 0.19 -0.29 1.04 1.06 -2.09 -0.75
sortVector :: (Ord t, Element t) => Vector t -> Vector thmatrix Numeric.LinearAlgebra.Data No documentation available.
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]
sortOn :: (Ord o, SemiSequence seq) => (Element seq -> o) -> seq -> seqmono-traversable Data.Sequences Same as sortBy . comparing. Since 0.7.0
sortBy :: (a -> a -> Ordering) -> [a] -> [a]rio RIO.List 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,"!")]