Commit 0ab63cf4 authored by niteria's avatar niteria

Kill varEnvElts in seqDmdEnv

GHC Trac: #4012
parent 0d522b80
......@@ -1306,8 +1306,7 @@ seqDmdType (DmdType env ds res) =
seqDmdEnv env `seq` seqDemandList ds `seq` seqDmdResult res `seq` ()
seqDmdEnv :: DmdEnv -> ()
seqDmdEnv env = seqDemandList (varEnvElts env)
seqDmdEnv env = seqEltsUFM seqDemandList env
splitDmdTy :: DmdType -> (Demand, DmdType)
-- Split off one function argument
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment