summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcEvidence.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-10-23 09:10:50 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-10-24 16:38:55 +0100
commit9aaa8971de7e8438ec0854d198f22385e1687076 (patch)
tree2d6c3851799c54cc07ad4123d1b5d80be286400c /compiler/typecheck/TcEvidence.hs
parentecfe38ef622a73a88caf9857d1752bd2d7541361 (diff)
downloadhaskell-9aaa8971de7e8438ec0854d198f22385e1687076.tar.gz
Remove unnecessary free-var-set deletion
In TcSimplify.neededEvVars, in add_implic_seeds we were deleting the 'givens'; but they are already deleted, so this is a no-op. This patch just remove the redundant delete.
Diffstat (limited to 'compiler/typecheck/TcEvidence.hs')
-rw-r--r--compiler/typecheck/TcEvidence.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs
index fa1908983a..1d6098dbf5 100644
--- a/compiler/typecheck/TcEvidence.hs
+++ b/compiler/typecheck/TcEvidence.hs
@@ -399,19 +399,16 @@ data EvBindsVar
-- Some Given, some Wanted
ebv_tcvs :: IORef CoVarSet
- -- The free coercion vars of the (rhss of) the coercion bindings
- -- All of these are Wanted
- --
- -- Coercions don't actually have bindings
- -- because we plug them in-place (via a mutable
- -- variable); but we keep their free variables
- -- so that we can report unused given constraints
+ -- The free Given coercion vars needed by Wanted coercions that
+ -- are solved by filling in their HoleDest in-place. Since they
+ -- don't appear in ebv_binds, we keep track of their free
+ -- variables so that we can report unused given constraints
-- See Note [Tracking redundant constraints] in TcSimplify
}
| CoEvBindsVar { -- See Note [Coercion evidence only]
- -- See above for comments on ebv_uniq, evb_tcvs
+ -- See above for comments on ebv_uniq, ebv_tcvs
ebv_uniq :: Unique,
ebv_tcvs :: IORef CoVarSet
}
@@ -834,6 +831,8 @@ evTermCoercion tm = case evTermCoercion_maybe tm of
********************************************************************* -}
findNeededEvVars :: EvBindMap -> VarSet -> VarSet
+-- Find all the Given evidence needed by seeds,
+-- looking transitively through binds
findNeededEvVars ev_binds seeds
= transCloVarSet also_needs seeds
where