From: simonpj Date: Mon, 20 Aug 2001 07:48:05 +0000 (+0000) Subject: [project @ 2001-08-20 07:48:05 by simonpj] X-Git-Tag: Approximately_9120_patches~1187 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=76138d21af004935bd7cf6cb9f91aeccbe775665;p=ghc-hetmet.git [project @ 2001-08-20 07:48:05 by simonpj] Print implicit-parameter bindings properly --- diff --git a/ghc/compiler/hsSyn/HsExpr.lhs b/ghc/compiler/hsSyn/HsExpr.lhs index f072ca3..ad3a25d 100644 --- a/ghc/compiler/hsSyn/HsExpr.lhs +++ b/ghc/compiler/hsSyn/HsExpr.lhs @@ -297,7 +297,7 @@ ppr_expr (HsLet binds expr) hang (ptext SLIT("in")) 2 (ppr expr)] ppr_expr (HsWith expr binds) - = hsep [ppr expr, ptext SLIT("with"), ppr binds] + = hsep [ppr expr, ptext SLIT("with"), pp_ipbinds binds] ppr_expr (HsDo do_or_list_comp stmts _) = pprDo do_or_list_comp stmts ppr_expr (HsDoOut do_or_list_comp stmts _ _ _ _ _) = pprDo do_or_list_comp stmts @@ -411,6 +411,13 @@ pp_rbinds thing rbinds hsep [ppr v, char '=', ppr e] \end{code} +\begin{code} +pp_ipbinds :: (Outputable id, Outputable pat) + => [(id, HsExpr id pat)] -> SDoc +pp_ipbinds pairs = hsep (punctuate semi (map pp_item pairs)) + where + pp_item (id,rhs) = char '?' <> ppr id <+> equals <+> ppr_expr rhs +\end{code} %************************************************************************