summaryrefslogtreecommitdiff
path: root/compiler/utils/UniqDFM.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/UniqDFM.hs')
-rw-r--r--compiler/utils/UniqDFM.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/utils/UniqDFM.hs b/compiler/utils/UniqDFM.hs
index aeb5b34116..e5424f2c5d 100644
--- a/compiler/utils/UniqDFM.hs
+++ b/compiler/utils/UniqDFM.hs
@@ -41,6 +41,7 @@ module UniqDFM (
isNullUDFM,
sizeUDFM,
intersectUDFM,
+ intersectsUDFM,
disjointUDFM,
minusUDFM,
partitionUDFM,
@@ -228,6 +229,9 @@ intersectUDFM (UDFM x i) (UDFM y _j) = UDFM (M.intersection x y) i
-- M.intersection is left biased, that means the result will only have
-- a subset of elements from the left set, so `i` is a good upper bound.
+intersectsUDFM :: UniqDFM elt -> UniqDFM elt -> Bool
+intersectsUDFM x y = isNullUDFM (x `intersectUDFM` y)
+
disjointUDFM :: UniqDFM elt -> UniqDFM elt -> Bool
disjointUDFM (UDFM x _i) (UDFM y _j) = M.null (M.intersection x y)