Everything from here on appears only in typechecker output.
\begin{code}
- | TyLam -- TRANSLATION
- [TyVar]
- (LHsExpr id)
- | TyApp -- TRANSLATION
- (LHsExpr id) -- generated by Spec
- [Type]
-
- -- DictLam and DictApp are "inverses"
- | DictLam
- [id]
- (LHsExpr id)
- | DictApp
- (LHsExpr id)
- [id]
-
| HsCoerce ExprCoFn -- TRANSLATION
(HsExpr id)
ppr_expr (HsSCC lbl expr)
= sep [ ptext SLIT("_scc_") <+> doubleQuotes (ftext lbl), pprParendExpr expr ]
-ppr_expr (TyLam tyvars expr)
- = hang (hsep [ptext SLIT("/\\"),
- hsep (map (pprBndr LambdaBind) tyvars),
- ptext SLIT("->")])
- 4 (ppr_lexpr expr)
-
-ppr_expr (TyApp expr [ty])
- = hang (ppr_lexpr expr) 4 (pprParendType ty)
-
-ppr_expr (TyApp expr tys)
- = hang (ppr_lexpr expr)
- 4 (brackets (interpp'SP tys))
-
-ppr_expr (DictLam dictvars expr)
- = hang (hsep [ptext SLIT("\\{-dict-}"),
- hsep (map (pprBndr LambdaBind) dictvars),
- ptext SLIT("->")])
- 4 (ppr_lexpr expr)
-
-ppr_expr (DictApp expr [dname])
- = hang (ppr_lexpr expr) 4 (ppr dname)
-
-ppr_expr (DictApp expr dnames)
- = hang (ppr_lexpr expr)
- 4 (brackets (interpp'SP dnames))
-
-ppr_expr (HsCoerce co_fn e) = ppr_expr e
+ppr_expr (HsCoerce co_fn e)
+ = ppr_expr e <+> ptext SLIT("`cast`") <+> ppr co_fn
ppr_expr (HsType id) = ppr id
\begin{code}
pprMatches :: (OutputableBndr id) => HsMatchContext id -> MatchGroup id -> SDoc
-pprMatches ctxt (MatchGroup matches _) = vcat (map (pprMatch ctxt) (map unLoc matches))
+pprMatches ctxt (MatchGroup matches ty) = (ppr ty) $$ vcat (map (pprMatch ctxt) (map unLoc matches))
-- Exported to HsBinds, which can't see the defn of HsMatchContext
pprFunBind :: (OutputableBndr id) => id -> MatchGroup id -> SDoc