summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-12-02 12:35:47 +0000
committersimonpj@microsoft.com <unknown>2010-12-02 12:35:47 +0000
commit5723262f616ac02ddf637f6ff480a599c737ea0d (patch)
tree33b118dccc94a129b9b56d157b9e60a4a90242fa /compiler/hsSyn
parentfbb99e831a0c0510e79b2f0c91bbdffd142ea951 (diff)
downloadhaskell-5723262f616ac02ddf637f6ff480a599c737ea0d.tar.gz
Re-jig simplifySuperClass (again)
This fixes the current loop in T3731, and will fix other reported loops. The loops show up when we are generating evidence for superclasses in an instance declaration. The trick is to make the "self" dictionary simplifySuperClass depend *explicitly* on the superclass we are currently trying to build. See Note [Dependencies in self dictionaries] in TcSimplify. That in turn means that EvDFunApp needs a dependency-list, used when chasing dependencies in isGoodRecEv.
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/HsBinds.lhs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsBinds.lhs b/compiler/hsSyn/HsBinds.lhs
index da247c28ed..0a4769dece 100644
--- a/compiler/hsSyn/HsBinds.lhs
+++ b/compiler/hsSyn/HsBinds.lhs
@@ -447,7 +447,10 @@ data EvTerm
| EvCast EvVar Coercion -- d |> co
| EvDFunApp DFunId -- Dictionary instance application
- [Type] [EvVar]
+ [Type] [EvVar]
+ [EvVar] -- The dependencies, which is generally a bigger list than
+ -- the arguments of the dfun.
+ -- See Note [Dependencies in self dictionaries] in TcSimplify
| EvSuperClass DictId Int -- n'th superclass. Used for both equalities and
-- dictionaries, even though the former have no
@@ -574,8 +577,7 @@ instance Outputable EvTerm where
ppr (EvCast v co) = ppr v <+> (ptext (sLit "`cast`")) <+> pprParendType co
ppr (EvCoercion co) = ppr co
ppr (EvSuperClass d n) = ptext (sLit "sc") <> parens (ppr (d,n))
- ppr (EvDFunApp df tys ts) = ppr df <+> sep [ char '@' <> ppr tys
- , ppr ts ]
+ ppr (EvDFunApp df tys ts deps) = ppr df <+> sep [ char '@' <> ppr tys, ppr ts, ppr deps ]
\end{code}
%************************************************************************