Class, ClassOpItem,
DefMeth (..),
- FunDep, pprFundeps,
+ FunDep, pprFundeps, pprFunDep,
mkClass, classTyVars, classArity,
classKey, className, classATs, classSelIds, classTyCon, classMethods,
pprFundeps :: Outputable a => [FunDep a] -> SDoc
pprFundeps [] = empty
-pprFundeps fds = hsep (ptext (sLit "|") : punctuate comma (map ppr_fd fds))
- where
- ppr_fd (us, vs) = hsep [interppSP us, ptext (sLit "->"),
- interppSP vs]
+pprFundeps fds = hsep (ptext (sLit "|") : punctuate comma (map pprFunDep fds))
+
+pprFunDep :: Outputable a => FunDep a -> SDoc
+pprFunDep (us, vs) = hsep [interppSP us, ptext (sLit "->"), interppSP vs]
\end{code}
, not (instanceCantMatch inst_tcs trimmed_tcs)
, eqn <- checkClsFD qtvs fd cls_tvs tys_inst tys
, let p_inst = (mkClassPred cls tys_inst,
- ptext (sLit "arising from the instance declaration at")
- <+> ppr (getSrcLoc ispec))
+ sep [ ptext (sLit "arising from the dependency") <+> quotes (pprFunDep fd)
+ , ptext (sLit "in the instance declaration at")
+ <+> ppr (getSrcLoc ispec)])
]
improveOne _ _ _