@@ -85,6 +85,8 @@ module Data.HashMap.Strict.Refined
8585 , differenceWith
8686 , differenceWithKey
8787 , PartialDifferenceProof(..)
88+ , Common.intersection
89+ , intersectionWith
8890 , intersectionWithKey
8991 , IntersectionProof(..)
9092 -- * Traversal
@@ -406,6 +408,17 @@ differenceWithKey f (HashMap m1) (HashMap m2) = SomeHashMapWith
406408 (HashMap.mapWithKey (,) m2))
407409 $ PartialDifferenceProof unsafeSubset unsafeSubset
408410
411+-- | Return the intersection of two maps with the given combining function.
412+intersectionWith
413+ :: forall s t k a b c. Hashable k
414+ => (a -> b -> c)
415+ -> HashMap s k a
416+ -> HashMap t k b
417+ -> SomeHashMapWith (IntersectionProof 'Hashed s t) k c
418+intersectionWith f (HashMap m1) (HashMap m2) = SomeHashMapWith
419+ (HashMap $ HashMap.intersectionWith f m1 m2)
420+ $ IntersectionProof unsafeSubset unsafeSubsetWith2
421+
409422-- | Return the intersection of two maps with the given combining function.
410423--
411424-- You can use 'andLeft' and 'andRight' to obtain @'Key' s k@ and @'Key' t k@