Skip to content

Commit 3229aae

Browse files
toyboot4eerikd
authored andcommitted
Fix to use INLINE for sort and sortUniq
1 parent 9e0d973 commit 3229aae

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/Data/Vector/Algorithms/AmericanFlag.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ sort :: forall e m v. (PrimMonad m, MVector v e, Lexicographic e, Ord e)
244244
sort v = sortBy compare terminate (size p) index v
245245
where p :: Proxy e
246246
p = Proxy
247-
{-# INLINABLE sort #-}
247+
{-# INLINE sort #-}
248248

249249
-- | A variant on `sort` that returns a vector of unique elements.
250250
sortUniq :: forall e m v. (PrimMonad m, MVector v e, Lexicographic e, Ord e)
251251
=> v (PrimState m) e -> m (v (PrimState m) e)
252252
sortUniq v = sortUniqBy compare terminate (size p) index v
253253
where p :: Proxy e
254254
p = Proxy
255-
{-# INLINABLE sortUniq #-}
255+
{-# INLINE sortUniq #-}
256256

257257
-- | A fully parameterized version of the sorting algorithm. Again, this
258258
-- function takes both radix information and a comparison, because the

src/Data/Vector/Algorithms/Heap.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ import qualified Data.Vector.Algorithms.Optimal as O
5656
-- | Sorts an entire array using the default ordering.
5757
sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m ()
5858
sort = sortBy compare
59-
{-# INLINABLE sort #-}
59+
{-# INLINE sort #-}
6060

6161
-- | A variant on `sort` that returns a vector of unique elements.
6262
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)
6363
sortUniq = sortUniqBy compare
64-
{-# INLINABLE sortUniq #-}
64+
{-# INLINE sortUniq #-}
6565

6666
-- | Sorts an entire array using a custom ordering.
6767
sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()

src/Data/Vector/Algorithms/Insertion.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ import qualified Data.Vector.Algorithms.Optimal as O
3636
-- | Sorts an entire array using the default comparison for the type
3737
sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m ()
3838
sort = sortBy compare
39-
{-# INLINABLE sort #-}
39+
{-# INLINE sort #-}
4040

4141
-- | A variant on `sort` that returns a vector of unique elements.
4242
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)
4343
sortUniq = sortUniqBy compare
44-
{-# INLINABLE sortUniq #-}
44+
{-# INLINE sortUniq #-}
4545

4646
-- | Sorts an entire array using a given comparison
4747
sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()

src/Data/Vector/Algorithms/Intro.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ import qualified Data.Vector.Algorithms.Heap as H
6767
-- | Sorts an entire array using the default ordering.
6868
sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m ()
6969
sort = sortBy compare
70-
{-# INLINABLE sort #-}
70+
{-# INLINE sort #-}
7171

7272
-- | A variant on `sort` that returns a vector of unique elements.
7373
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)
7474
sortUniq = sortUniqBy compare
75-
{-# INLINABLE sortUniq #-}
75+
{-# INLINE sortUniq #-}
7676

7777
-- | A variant on `sortBy` which returns a vector of unique elements.
7878
sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()

src/Data/Vector/Algorithms/Merge.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ import qualified Data.Vector.Algorithms.Insertion as I
3737
-- | Sorts an array using the default comparison.
3838
sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m ()
3939
sort = sortBy compare
40-
{-# INLINABLE sort #-}
40+
{-# INLINE sort #-}
4141

4242
-- | A variant on `sort` that returns a vector of unique elements.
4343
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)
4444
sortUniq = sortUniqBy compare
45-
{-# INLINABLE sortUniq #-}
45+
{-# INLINE sortUniq #-}
4646

4747
-- | Sorts an array using a custom comparison.
4848
sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m ()

src/Data/Vector/Algorithms/Radix.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ sort arr = sortBy (passes e) (size e) radix arr
186186
where
187187
e :: e
188188
e = undefined
189-
{-# INLINABLE sort #-}
189+
{-# INLINE sort #-}
190190

191191
-- | Radix sorts an array using custom radix information
192192
-- requires the number of passes to fully sort the array,

src/Data/Vector/Algorithms/Tim.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ import Data.Vector.Algorithms.Common (uniqueMutableBy)
113113
-- | Sorts an array using the default comparison.
114114
sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m ()
115115
sort = sortBy compare
116-
{-# INLINABLE sort #-}
116+
{-# INLINE sort #-}
117117

118118
-- | A variant on `sort` that returns a vector of unique elements.
119119
sortUniq :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m (v (PrimState m) e)
120120
sortUniq = sortUniqBy compare
121-
{-# INLINABLE sortUniq #-}
121+
{-# INLINE sortUniq #-}
122122

123123
-- | Sorts an array using a custom comparison.
124124
sortBy :: (PrimMonad m, MVector v e)

0 commit comments

Comments
 (0)