File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -740,7 +740,10 @@ collision h !e1 !e2 =
740
740
741
741
-- | Create a 'BitmapIndexed' or 'Full' node.
742
742
bitmapIndexedOrFull :: Bitmap -> A. Array (HashMap k v ) -> HashMap k v
743
- bitmapIndexedOrFull b ary
743
+ -- The strictness in @ary@ helps achieve a nice code size reduction in
744
+ -- @unionWith[Key]@ with GHC 9.2.2. See the Core diffs in
745
+ -- https://github.com/haskell-unordered-containers/unordered-containers/pull/376.
746
+ bitmapIndexedOrFull b ! ary
744
747
| b == fullNodeMask = Full ary
745
748
| otherwise = BitmapIndexed b ary
746
749
{-# INLINE bitmapIndexedOrFull #-}
@@ -1615,7 +1618,10 @@ unionWithKey f = go 0
1615
1618
-- | Strict in the result of @f@.
1616
1619
unionArrayBy :: (a -> a -> a ) -> Bitmap -> Bitmap -> A. Array a -> A. Array a
1617
1620
-> A. Array a
1618
- unionArrayBy f b1 b2 ary1 ary2 = A. run $ do
1621
+ -- The manual forcing of @b1@, @b2@, @ary1@ and @ary2@ results in handsome
1622
+ -- Core size reductions with GHC 9.2.2. See the Core diffs in
1623
+ -- https://github.com/haskell-unordered-containers/unordered-containers/pull/376.
1624
+ unionArrayBy f ! b1 ! b2 ! ary1 ! ary2 = A. run $ do
1619
1625
let b' = b1 .|. b2
1620
1626
mary <- A. new_ (popCount b')
1621
1627
-- iterate over nonzero bits of b1 .|. b2
You can’t perform that action at this time.
0 commit comments