vector-algorithms 0.9.0.3 → 0.9.1.0
raw patch · 10 files changed
+28/−29 lines, 10 filesdep ~QuickCheck
Dependency ranges changed: QuickCheck
Files
- CHANGELOG.md +4/−0
- src/Data/Vector/Algorithms.hs +3/−0
- src/Data/Vector/Algorithms/AmericanFlag.hs +2/−2
- src/Data/Vector/Algorithms/Heap.hs +2/−2
- src/Data/Vector/Algorithms/Insertion.hs +2/−2
- src/Data/Vector/Algorithms/Intro.hs +2/−2
- src/Data/Vector/Algorithms/Merge.hs +2/−2
- src/Data/Vector/Algorithms/Radix.hs +1/−1
- src/Data/Vector/Algorithms/Tim.hs +2/−2
- vector-algorithms.cabal +8/−16
CHANGELOG.md view
@@ -1,3 +1,7 @@+## Version 0.9.1.0 (2025-02-05)++- More inlining for `sort` and `nib` functions.+ ## Version 0.9.0.3 (2024-11-25) - Fix an off-by-one error Heap.partialSort functions.
src/Data/Vector/Algorithms.hs view
@@ -18,6 +18,7 @@ -- | The `nub` function which removes duplicate elements from a vector. nub :: forall v e . (V.Vector v e, Ord e) => v e -> v e nub = nubBy compare+{-# INLINE nub #-} -- | A version of `nub` with a custom comparison predicate. --@@ -31,6 +32,7 @@ destMV <- nubByMut sortUniqBy cmp mv v <- V.unsafeFreeze destMV pure (V.force v)+{-# INLINE nubBy #-} -- | The `nubByMut` function takes in an in-place sort algorithm -- and uses it to do a de-deduplicated sort. It then uses this to@@ -72,3 +74,4 @@ go (srcInd + 1) (destInd + 1) go 0 0 pure dest+{-# INLINABLE nubByMut #-}
src/Data/Vector/Algorithms/AmericanFlag.hs view
@@ -244,7 +244,7 @@ sort v = sortBy compare terminate (size p) index v where p :: Proxy e p = Proxy-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: forall e m v. (PrimMonad m, MVector v e, Lexicographic e, Ord e)@@ -252,7 +252,7 @@ sortUniq v = sortUniqBy compare terminate (size p) index v where p :: Proxy e p = Proxy-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | A fully parameterized version of the sorting algorithm. Again, this -- function takes both radix information and a comparison, because the
src/Data/Vector/Algorithms/Heap.hs view
@@ -56,12 +56,12 @@ -- | Sorts an entire array using the default ordering. sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e) sortUniq = sortUniqBy compare-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | Sorts an entire array using a custom ordering. sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()
src/Data/Vector/Algorithms/Insertion.hs view
@@ -36,12 +36,12 @@ -- | Sorts an entire array using the default comparison for the type sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e) sortUniq = sortUniqBy compare-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | Sorts an entire array using a given comparison sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()
src/Data/Vector/Algorithms/Intro.hs view
@@ -67,12 +67,12 @@ -- | Sorts an entire array using the default ordering. sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e) sortUniq = sortUniqBy compare-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | A variant on `sortBy` which returns a vector of unique elements. sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()
src/Data/Vector/Algorithms/Merge.hs view
@@ -37,12 +37,12 @@ -- | Sorts an array using the default comparison. sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e) sortUniq = sortUniqBy compare-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | Sorts an array using a custom comparison. sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()
src/Data/Vector/Algorithms/Radix.hs view
@@ -186,7 +186,7 @@ where e :: e e = undefined-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | Radix sorts an array using custom radix information -- requires the number of passes to fully sort the array,
src/Data/Vector/Algorithms/Tim.hs view
@@ -113,12 +113,12 @@ -- | Sorts an array using the default comparison. sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare-{-# INLINABLE sort #-}+{-# INLINE sort #-} -- | A variant on `sort` that returns a vector of unique elements. sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e) sortUniq = sortUniqBy compare-{-# INLINABLE sortUniq #-}+{-# INLINE sortUniq #-} -- | Sorts an array using a custom comparison. sortBy :: (PrimMonad m, MVector v e)
vector-algorithms.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: vector-algorithms-version: 0.9.0.3+version: 0.9.1.0 license: BSD3 license-file: LICENSE author: Dan Doel@@ -30,7 +30,6 @@ GHC == 8.6.5 GHC == 8.4.4 GHC == 8.2.2- GHC == 8.0.2 flag BoundsChecks description: Enable bounds checking@@ -51,10 +50,6 @@ performance default: True -flag properties- description: Enable the quickcheck tests- default: True- -- flag dump-simpl -- description: Dumps the simplified core during compilation -- default: False@@ -154,16 +149,13 @@ Properties Util - if !flag(properties)- buildable: False- else- build-depends:- base >= 4.9,- bytestring,- containers,- QuickCheck > 2.9 && < 2.16,- vector,- vector-algorithms+ build-depends:+ base >= 4.9,+ bytestring,+ containers,+ QuickCheck > 2.9 && < 2.16,+ vector,+ vector-algorithms if flag(llvm) ghc-options: -fllvm