@@ -267,6 +267,7 @@ instance (Show k, Show v) => Show (HashMap k v) where
267267
268268instance Traversable (HashMap k ) where
269269 traverse f = traverseWithKey (const f)
270+ {-# INLINABLE traverse #-}
270271
271272#if MIN_VERSION_base(4,9,0)
272273instance Eq2 HashMap where
@@ -1387,7 +1388,9 @@ unionArrayBy f b1 b2 ary1 ary2 = A.run $ do
13871388 | m > b' = return ()
13881389 | b' .&. m == 0 = go i i1 i2 (m `unsafeShiftL` 1 )
13891390 | ba .&. m /= 0 = do
1390- A. write mary i $! f (A. index ary1 i1) (A. index ary2 i2)
1391+ x1 <- A. indexM ary1 i1
1392+ x2 <- A. indexM ary2 i2
1393+ A. write mary i $! f x1 x2
13911394 go (i+ 1 ) (i1+ 1 ) (i2+ 1 ) (m `unsafeShiftL` 1 )
13921395 | b1 .&. m /= 0 = do
13931396 A. write mary i =<< A. indexM ary1 i1
@@ -1657,7 +1660,7 @@ filterMapAux onLeaf onColl = go
16571660 return $! Collision h ary2
16581661 | otherwise -> do ary2 <- A. trim mary j
16591662 return $! Collision h ary2
1660- | Just el <- onColl ( A. index ary i)
1663+ | Just el <- onColl $! A. index ary i
16611664 = A. write mary j el >> step ary mary (i+ 1 ) (j+ 1 ) n
16621665 | otherwise = step ary mary (i+ 1 ) j n
16631666{-# INLINE filterMapAux #-}
@@ -1830,7 +1833,9 @@ update16M ary idx b = do
18301833
18311834-- | /O(n)/ Update the element at the given position in this array, by applying a function to it.
18321835update16With' :: A. Array e -> Int -> (e -> e ) -> A. Array e
1833- update16With' ary idx f = update16 ary idx $! f (A. index ary idx)
1836+ update16With' ary idx f
1837+ | (# x # ) <- A. index# ary idx
1838+ = update16 ary idx $! f x
18341839{-# INLINE update16With' #-}
18351840
18361841-- | Unsafely clone an array of 16 elements. The length of the input
0 commit comments