unionArrayBy and intersectionArrayBy currently use countTrailingZeros to detect set bits in bitmaps.
Alternatively, lowest set bits can be isolated like this:
isolateLowestSetBit :: Word -> Word
isolateLowestSetBit x = x .&. negate x
(Explanation in https://stackoverflow.com/a/12250963/1013393)
The latter technique is already being used in submapBitmapIndexed to create the initial bit mask.
It would be good to consistently use only one technique, ideally by refactoring this pattern into a proper function like isolateLowestSetBit.