File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import qualified Data.Vector.Algorithms.Search as S
18
18
-- | The `nub` function which removes duplicate elements from a vector.
19
19
nub :: forall v e . (V. Vector v e , Ord e ) => v e -> v e
20
20
nub = nubBy compare
21
+ {-# INLINE nub #-}
21
22
22
23
-- | A version of `nub` with a custom comparison predicate.
23
24
--
@@ -31,6 +32,7 @@ nubBy cmp vec = runST $ do
31
32
destMV <- nubByMut sortUniqBy cmp mv
32
33
v <- V. unsafeFreeze destMV
33
34
pure (V. force v)
35
+ {-# INLINE nubBy #-}
34
36
35
37
-- | The `nubByMut` function takes in an in-place sort algorithm
36
38
-- and uses it to do a de-deduplicated sort. It then uses this to
@@ -72,3 +74,4 @@ nubByMut alg cmp inp = do
72
74
go (srcInd + 1 ) (destInd + 1 )
73
75
go 0 0
74
76
pure dest
77
+ {-# INLINABLE nubByMut #-}
You can’t perform that action at this time.
0 commit comments