[commit: ghc] master: Collect coercion variables, not type variables (f9308c2)

git at git.haskell.org git at git.haskell.org
Thu Oct 27 07:28:51 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f9308c2a682d45e061eaa169c4f2389009a9177e/ghc

>---------------------------------------------------------------

commit f9308c2a682d45e061eaa169c4f2389009a9177e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 26 14:58:59 2016 +0100

    Collect coercion variables, not type variables
    
    ...when tracking which constraints are used.
    
    Previously we were gathering type variables too, which meant that the
    ics_need field was (stupidly) non-empty, which meant that we kept hold
    of solved implications for no purpose.  Better just to get rid of them,
    which setImplicationStatus is all ste up to to do.
    
    No change in behaviour; a bit more efficient.


>---------------------------------------------------------------

f9308c2a682d45e061eaa169c4f2389009a9177e
 compiler/typecheck/TcEvidence.hs | 4 ++--
 compiler/typecheck/TcSMonad.hs   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs
index ae98d38..e513f93 100644
--- a/compiler/typecheck/TcEvidence.hs
+++ b/compiler/typecheck/TcEvidence.hs
@@ -292,8 +292,8 @@ data EvBindsVar
       -- The main payload: the value-level evidence bindings
       --     (dictionaries etc)
 
-      ebv_tcvs :: IORef TyCoVarSet
-      -- The free vars of the (rhss of) the coercion bindings
+      ebv_tcvs :: IORef CoVarSet
+      -- The free coercion vars of the (rhss of) the coercion bindings
       --
       -- Coercions don't actually have bindings
       -- because we plug them in-place (via a mutable
diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs
index a362cef..504bc66 100644
--- a/compiler/typecheck/TcSMonad.hs
+++ b/compiler/typecheck/TcSMonad.hs
@@ -2960,7 +2960,7 @@ setEvBind ev_bind
        ; wrapTcS $ TcM.addTcEvBind evb ev_bind }
 
 -- | Mark variables as used filling a coercion hole
-useVars :: TyCoVarSet -> TcS ()
+useVars :: CoVarSet -> TcS ()
 useVars vars
   = do { EvBindsVar { ebv_tcvs = ref } <- getTcEvBindsVar
        ; wrapTcS $
@@ -2971,7 +2971,7 @@ useVars vars
 -- | Equalities only
 setWantedEq :: TcEvDest -> Coercion -> TcS ()
 setWantedEq (HoleDest hole) co
-  = do { useVars (tyCoVarsOfCo co)
+  = do { useVars (coVarsOfCo co)
        ; wrapTcS $ TcM.fillCoercionHole hole co }
 setWantedEq (EvVarDest ev) _ = pprPanic "setWantedEq" (ppr ev)
 
@@ -2984,7 +2984,7 @@ setEqIfWanted _ _ = return ()
 setWantedEvTerm :: TcEvDest -> EvTerm -> TcS ()
 setWantedEvTerm (HoleDest hole) tm
   = do { let co = evTermCoercion tm
-       ; useVars (tyCoVarsOfCo co)
+       ; useVars (coVarsOfCo co)
        ; wrapTcS $ TcM.fillCoercionHole hole co }
 setWantedEvTerm (EvVarDest ev) tm = setWantedEvBind ev tm
 



More information about the ghc-commits mailing list