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
1818-- | The `nub` function which removes duplicate elements from a vector.
1919nub :: forall v e . (V. Vector v e , Ord e ) => v e -> v e
2020nub = nubBy compare
21+ {-# INLINE nub #-}
2122
2223-- | A version of `nub` with a custom comparison predicate.
2324--
@@ -31,6 +32,7 @@ nubBy cmp vec = runST $ do
3132 destMV <- nubByMut sortUniqBy cmp mv
3233 v <- V. unsafeFreeze destMV
3334 pure (V. force v)
35+ {-# INLINE nubBy #-}
3436
3537-- | The `nubByMut` function takes in an in-place sort algorithm
3638-- and uses it to do a de-deduplicated sort. It then uses this to
@@ -72,3 +74,4 @@ nubByMut alg cmp inp = do
7274 go (srcInd + 1 ) (destInd + 1 )
7375 go 0 0
7476 pure dest
77+ {-# INLINABLE nubByMut #-}
You can’t perform that action at this time.
0 commit comments