[commit: ghc] wip/impredicativity: Add instantiation in rule checking (d737c81)

git at git.haskell.org git at git.haskell.org
Tue Aug 4 08:56:10 UTC 2015


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

On branch  : wip/impredicativity
Link       : http://ghc.haskell.org/trac/ghc/changeset/d737c812c922042020ec71c22b09c5c8248a6df0/ghc

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

commit d737c812c922042020ec71c22b09c5c8248a6df0
Author: Alejandro Serrano <trupill at gmail.com>
Date:   Tue Aug 4 10:57:21 2015 +0200

    Add instantiation in rule checking


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

d737c812c922042020ec71c22b09c5c8248a6df0
 compiler/typecheck/TcRules.hs    | 5 +++--
 compiler/typecheck/TcSimplify.hs | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs
index aafb520..193695a 100644
--- a/compiler/typecheck/TcRules.hs
+++ b/compiler/typecheck/TcRules.hs
@@ -73,8 +73,9 @@ tcRule (HsRule name act hs_bndrs lhs fv_lhs rhs fv_rhs)
                tcExtendIdEnv    id_bndrs $
                do { -- See Note [Solve order for RULES]
                     ((lhs', rule_ty), lhs_wanted) <- captureConstraints (tcInferRho lhs)
-                  ; (lhs_inst_simple, _) <- runTcS (instantiateCts (wc_simple lhs_wanted))
-                  ; let lhs_inst = lhs_wanted { wc_simple = lhs_inst_simple }
+                  ; let lhs_wanted_simple = wc_simple lhs_wanted
+                  ; (lhs_inst_simple, _) <- runTcS (instantiateCts lhs_wanted_simple)
+                  ; let lhs_inst = lhs_wanted { wc_simple = lhs_inst_simple `unionBags` lhs_wanted_simple }
                   ; (rhs', rhs_wanted) <- captureConstraints (tcPolyMonoExpr rhs rule_ty)
                   ; return (lhs', lhs_inst, rhs', rhs_wanted, rule_ty) }
 
diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index e95c9f7..2fd74b8 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -8,9 +8,9 @@ module TcSimplify(
        simplifyTop, simplifyInteractive,
        solveWantedsTcM,
 
-       -- For Rules we need these three
-       solveWanteds, runTcS, approximateWC,
-       instantiateCts
+       -- For Rules we need these
+       solveWanteds, runTcS, runTcSWithEvBinds,
+       approximateWC, instantiateCts
   ) where
 
 #include "HsVersions.h"



More information about the ghc-commits mailing list