summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Serrano <trupill@gmail.com>2015-08-04 10:57:21 +0200
committerAlejandro Serrano <trupill@gmail.com>2015-08-04 10:57:21 +0200
commitd737c812c922042020ec71c22b09c5c8248a6df0 (patch)
treeff5e3766aea7543ff0fed45b76393a094d2a2c09
parent864c14a8c605b838c16127c5195f41860db2919f (diff)
downloadhaskell-wip/impredicativity.tar.gz
Add instantiation in rule checkingwip/impredicativity
-rw-r--r--compiler/typecheck/TcRules.hs5
-rw-r--r--compiler/typecheck/TcSimplify.hs6
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs
index aafb5209e5..193695af45 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 e95c9f7e77..2fd74b86ad 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"