[commit: ghc] master: Tiny refactor plus comments (0aaea5b)

git at git.haskell.org git at git.haskell.org
Fri Jun 26 07:33:20 UTC 2015


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

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

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

commit 0aaea5b8345fc4b061b97df8bcaa7c6b07594719
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jun 26 08:31:37 2015 +0100

    Tiny refactor plus comments


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

0aaea5b8345fc4b061b97df8bcaa7c6b07594719
 compiler/typecheck/TcDeriv.hs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs
index bbb9dc3..9045e39 100644
--- a/compiler/typecheck/TcDeriv.hs
+++ b/compiler/typecheck/TcDeriv.hs
@@ -1817,8 +1817,7 @@ simplifyDeriv pred tvs theta
                 -- We use *non-overlappable* (vanilla) skolems
                 -- See Note [Overlap and deriving]
 
-       ; let subst_skol = zipTopTvSubst tvs_skols $ map mkTyVarTy tvs
-             skol_set   = mkVarSet tvs_skols
+       ; let skol_set = mkVarSet tvs_skols
              doc = ptext (sLit "deriving") <+> parens (ppr pred)
 
        ; wanted <- mapM (\(PredOrigin t o) -> newWanted o (substTy skol_subst t)) theta
@@ -1839,13 +1838,18 @@ simplifyDeriv pred tvs theta
                          | otherwise = Right ct
                          where p = ctPred ct
 
+       ; traceTc "simplifyDeriv 2" $
+         vcat [ ppr tvs_skols, ppr residual_simple, ppr good, ppr bad ]
+
        -- If we are deferring type errors, simply ignore any insoluble
        -- constraints.  They'll come up again when we typecheck the
        -- generated instance declaration
        ; defer <- goptM Opt_DeferTypeErrors
        ; unless defer (reportAllUnsolved (residual_wanted { wc_simple = bad }))
 
-       ; let min_theta = mkMinimalBySCs (bagToList good)
+       ; let min_theta  = mkMinimalBySCs (bagToList good)
+             subst_skol = zipTopTvSubst tvs_skols $ map mkTyVarTy tvs
+                          -- The reverse substitution (sigh)
        ; return (substTheta subst_skol min_theta) }
 
 {-



More information about the ghc-commits mailing list