summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Solver/Rewrite.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-03-04 08:24:46 +0000
committerSimon Peyton Jones <simon.peytonjones@gmail.com>2023-03-22 09:50:13 +0000
commite0b8eaf3fc3d2ebbdcc86610b889930dbe5b4cdb (patch)
tree4f4c65db923be03b3cce67b2cc3f7fffe7131424 /compiler/GHC/Tc/Solver/Rewrite.hs
parentad765b6f0bb23576fb4e7690a29fa07fc1dfff11 (diff)
downloadhaskell-e0b8eaf3fc3d2ebbdcc86610b889930dbe5b4cdb.tar.gz
Refactor the constraint solver pipelinewip/T23070
The big change is to put the entire type-equality solver into GHC.Tc.Solver.Equality, rather than scattering it over Canonical and Interact. Other changes * EqCt becomes its own data type, a bit like QCInst. This is great because EqualCtList is then just [EqCt] * New module GHC.Tc.Solver.Dict has come of the class-contraint solver. In due course it will be all. One step at a time. This MR is intended to have zero change in behaviour: it is a pure refactor. It opens the way to subsequent tidying up, we believe.
Diffstat (limited to 'compiler/GHC/Tc/Solver/Rewrite.hs')
-rw-r--r--compiler/GHC/Tc/Solver/Rewrite.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/Tc/Solver/Rewrite.hs b/compiler/GHC/Tc/Solver/Rewrite.hs
index 16ab2471b3..6508a21420 100644
--- a/compiler/GHC/Tc/Solver/Rewrite.hs
+++ b/compiler/GHC/Tc/Solver/Rewrite.hs
@@ -1012,9 +1012,9 @@ rewrite_tyvar2 tv fr@(_, eq_rel)
; case lookupDVarEnv ieqs tv of
Just equal_ct_list
| Just ct <- find can_rewrite equal_ct_list
- , CEqCan { cc_ev = ctev, cc_lhs = TyVarLHS tv
- , cc_rhs = rhs_ty, cc_eq_rel = ct_eq_rel } <- ct
- -> do { let wrw = isWantedCt ct
+ , EqCt { eq_ev = ctev, eq_lhs = TyVarLHS tv
+ , eq_rhs = rhs_ty, eq_eq_rel = ct_eq_rel } <- ct
+ -> do { let wrw = isWanted ctev
; traceRewriteM "Following inert tyvar" $
vcat [ ppr tv <+> equals <+> ppr rhs_ty
, ppr ctev
@@ -1035,8 +1035,8 @@ rewrite_tyvar2 tv fr@(_, eq_rel)
_other -> return RTRNotFollowed }
where
- can_rewrite :: Ct -> Bool
- can_rewrite ct = ctFlavourRole ct `eqCanRewriteFR` fr
+ can_rewrite :: EqCt -> Bool
+ can_rewrite ct = eqCtFlavourRole ct `eqCanRewriteFR` fr
-- This is THE key call of eqCanRewriteFR
{-