summaryrefslogtreecommitdiff
path: root/compiler/utils/UniqFM.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-07-01 06:50:55 -0700
committerBartosz Nitka <niteria@gmail.com>2016-07-01 08:26:01 -0700
commit0ab63cf48580abbfe15ece934aec093203f29ed2 (patch)
tree1959d3808a4c1ffe3dfab003ccef26be394964f0 /compiler/utils/UniqFM.hs
parent0d522b80bc9d3cfc2b23a3a4d9092e08f006054e (diff)
downloadhaskell-0ab63cf48580abbfe15ece934aec093203f29ed2.tar.gz
Kill varEnvElts in seqDmdEnv
GHC Trac: #4012
Diffstat (limited to 'compiler/utils/UniqFM.hs')
-rw-r--r--compiler/utils/UniqFM.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/utils/UniqFM.hs b/compiler/utils/UniqFM.hs
index 261dd1c622..bb9d95c93a 100644
--- a/compiler/utils/UniqFM.hs
+++ b/compiler/utils/UniqFM.hs
@@ -54,7 +54,7 @@ module UniqFM (
intersectUFM_C,
disjointUFM,
nonDetFoldUFM, foldUFM, nonDetFoldUFM_Directly,
- anyUFM, allUFM,
+ anyUFM, allUFM, seqEltsUFM,
mapUFM, mapUFM_Directly,
elemUFM, elemUFM_Directly,
filterUFM, filterUFM_Directly, partitionUFM,
@@ -292,6 +292,12 @@ anyUFM p (UFM m) = M.fold ((||) . p) False m
allUFM :: (elt -> Bool) -> UniqFM elt -> Bool
allUFM p (UFM m) = M.fold ((&&) . p) True m
+seqEltsUFM :: ([elt] -> ()) -> UniqFM elt -> ()
+seqEltsUFM seqList = seqList . nonDetEltsUFM
+ -- It's OK to use nonDetEltsUFM here because the type guarantees that
+ -- the only interesting thing this function can do is to force the
+ -- elements.
+
-- See Note [Deterministic UniqFM] to learn about nondeterminism.
-- If you use this please provide a justification why it doesn't introduce
-- nondeterminism.