summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcSimplify.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-05-24 02:56:59 -0700
committerBartosz Nitka <niteria@gmail.com>2016-05-24 04:33:21 -0700
commit4c6e69d58a300d6ef440d326a3fd29b58b284fa1 (patch)
tree6653f56c150c3aa988a96c50359d53f27f2edb01 /compiler/typecheck/TcSimplify.hs
parent8f7d01632cd79957fe42ea37103ca9b91a1c54f5 (diff)
downloadhaskell-4c6e69d58a300d6ef440d326a3fd29b58b284fa1.tar.gz
Document some benign nondeterminism
I've changed the functions to their nonDet equivalents and explained why they're OK there. This allowed me to remove foldNameSet, foldVarEnv, foldVarEnv_Directly, foldVarSet and foldUFM_Directly. Test Plan: ./validate, there should be no change in behavior Reviewers: simonpj, simonmar, austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2244 GHC Trac Issues: #4012
Diffstat (limited to 'compiler/typecheck/TcSimplify.hs')
-rw-r--r--compiler/typecheck/TcSimplify.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 07c0a234f4..4c621ddf2f 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -42,6 +42,7 @@ import Unify ( tcMatchTy )
import Util
import Var
import VarSet
+import UniqFM
import BasicTypes ( IntWithInf, intGtLimit )
import ErrUtils ( emptyMessages )
import qualified GHC.LanguageExtensions as LangExt
@@ -1367,7 +1368,9 @@ neededEvVars ev_binds initial_seeds
also_needs :: VarSet -> VarSet
also_needs needs
- = foldVarSet add emptyVarSet needs
+ = nonDetFoldUFM add emptyVarSet needs
+ -- It's OK to use nonDetFoldUFM here because we immediately forget
+ -- about the ordering by creating a set
where
add v needs
| Just ev_bind <- lookupEvBind ev_binds v