From d737c812c922042020ec71c22b09c5c8248a6df0 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Tue, 4 Aug 2015 10:57:21 +0200 Subject: Add instantiation in rule checking --- 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 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" -- cgit v1.2.1