Hoogle Search
Within LTS Haskell 24.5 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sortMsgBag :: Maybe DiagOpts -> Bag (MsgEnvelope e) -> [MsgEnvelope e]ghc-lib-parser GHC.Utils.Error No documentation available.
sortWith :: Ord b => (a -> b) -> [a] -> [a]ghc-lib-parser GHC.Utils.Misc The sortWith function sorts a list of elements using the user supplied function to project something out of each element In general if the user supplied function is expensive to compute then you should probably be using sortOn, as it only needs to compute it once for each element. sortWith, on the other hand must compute the mapping function for every comparison that it performs.
-
express Data.Express.Fixtures List sort lifted over the Expr type. Works for the element types Int, Char and Bool.
> sort' $ unit one sort [1] :: Int
> sort' $ unit bee sort "b" :: Int
> sort' $ zero -:- unit two sort [0,2] :: Int
> evl $ sort' $ two -:- unit one :: [Int] [1,2]
sortBy :: Sequential c => (Element c -> Element c -> Ordering) -> c -> cfoundation Foundation Sort an ordered collection using the specified order function
sortBy :: Sequential c => (Element c -> Element c -> Ordering) -> c -> cfoundation Foundation.Collection Sort an ordered collection using the specified order function
sorts :: Ord a => Dims -> Array a -> Array aharpie Harpie.Array Sort an array along the supplied dimensions.
>>> sorts [0] (array [2,2] [2,3,1,4]) UnsafeArray [2,2] [1,4,2,3] >>> sorts [1] (array [2,2] [2,3,1,4]) UnsafeArray [2,2] [2,3,1,4] >>> sorts [0,1] (array [2,2] [2,3,1,4]) UnsafeArray [2,2] [1,2,3,4]
sortsBy :: Ord b => Dims -> (Array a -> Array b) -> Array a -> Array aharpie Harpie.Array The indices into the array if it were sorted by a comparison function along the dimensions supplied.
>>> import Data.Ord (Down (..)) >>> sortsBy [0] (fmap Down) (array [2,2] [2,3,1,4]) UnsafeArray [2,2] [2,3,1,4]
-
harpie Harpie.Fixed Sort an array along the supplied dimensions.
>>> pretty $ sorts (Dims @'[0]) (array @[2,2] [2,3,1,4]) [[1,4], [2,3]] >>> pretty $ sorts (Dims @'[1]) (array @[2,2] [2,3,1,4]) [[2,3], [1,4]] >>> pretty $ sorts (Dims @[0,1]) (array @[2,2] [2,3,1,4]) [[1,2], [3,4]]
-
harpie Harpie.Fixed The indices into the array if it were sorted by a comparison function along the dimensions supplied.
>>> import Data.Ord (Down (..)) >>> toDynamic $ sortsBy (Dims @'[0]) (fmap Down) (array @[2,2] [2,3,1,4]) UnsafeArray [2,2] [2,3,1,4]
sortByV :: Ord b => (a -> b) -> Vector a -> Vector aharpie Harpie.Sort return the array sorted by the comparison function
>>> sortByV Down (V.fromList [3,1,4,2,0,5::Int]) [5,4,3,2,1,0]