X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FHsExpr.lhs;h=86c41906bf3cc339d4d3243245a1f578ade9eeab;hb=a7ecdf96844404b7bc8273d4ff6d85759278427c;hp=4ae6ce40b5e6ca60b354fb9f6885960c82bdf5ec;hpb=8a9aba1ff5e66aad02aba0997339ea6ec60d6b1e;p=ghc-hetmet.git diff --git a/ghc/compiler/hsSyn/HsExpr.lhs b/ghc/compiler/hsSyn/HsExpr.lhs index 4ae6ce4..86c4190 100644 --- a/ghc/compiler/hsSyn/HsExpr.lhs +++ b/ghc/compiler/hsSyn/HsExpr.lhs @@ -14,7 +14,7 @@ import HsPat ( LPat ) import HsLit ( HsLit(..), HsOverLit ) import HsTypes ( LHsType, PostTcType ) import HsImpExp ( isOperator, pprHsVar ) -import HsBinds ( HsBindGroup, DictBinds ) +import HsBinds ( HsLocalBinds, DictBinds, isEmptyLocalBinds ) -- others: import Type ( Type, pprParendType ) @@ -121,7 +121,7 @@ data HsExpr id (LHsExpr id) -- then part (LHsExpr id) -- else part - | HsLet [HsBindGroup id] -- let(rec) + | HsLet (HsLocalBinds id) -- let(rec) (LHsExpr id) | HsDo (HsStmtContext Name) -- The parameterisation is unimportant @@ -274,8 +274,8 @@ pprExpr :: OutputableBndr id => HsExpr id -> SDoc pprExpr e = pprDeeper (ppr_expr e) -pprBinds :: OutputableBndr id => [HsBindGroup id] -> SDoc -pprBinds b = pprDeeper (vcat (map ppr b)) +pprBinds :: OutputableBndr id => HsLocalBinds id -> SDoc +pprBinds b = pprDeeper (ppr b) ppr_lexpr :: OutputableBndr id => LHsExpr id -> SDoc ppr_lexpr e = ppr_expr (unLoc e) @@ -528,7 +528,7 @@ The legal constructors for commands are: (HsCmd id) -- else part SrcLoc - | HsLet (HsBinds id) -- let(rec) + | HsLet (HsLocalBinds id) -- let(rec) (HsCmd id) | HsDo (HsStmtContext Name) -- The parameterisation is unimportant @@ -619,7 +619,7 @@ hsLMatchPats (L _ (Match pats _ _)) = pats -- GRHSs are used both for pattern bindings and for Matches data GRHSs id = GRHSs [LGRHS id] -- Guarded RHSs - [HsBindGroup id] -- The where clause + (HsLocalBinds id) -- The where clause type LGRHS id = Located (GRHS id) @@ -663,7 +663,7 @@ pprGRHSs :: OutputableBndr id => HsMatchContext id -> GRHSs id -> SDoc pprGRHSs ctxt (GRHSs grhss binds) = vcat (map (pprGRHS ctxt . unLoc) grhss) $$ - (if null binds then empty + (if isEmptyLocalBinds binds then empty else text "where" $$ nest 4 (pprBinds binds)) pprGRHS :: OutputableBndr id => HsMatchContext id -> GRHS id -> SDoc @@ -700,7 +700,7 @@ data Stmt id (SyntaxExpr id) -- The (>>) operator PostTcType -- Element type of the RHS (used for arrows) - | LetStmt [HsBindGroup id] + | LetStmt (HsLocalBinds id) -- ParStmts only occur in a list comprehension | ParStmt [([LStmt id], [id])] -- After renaming, the ids are the binders