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 )
(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
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)
(HsCmd id) -- else part
SrcLoc
- | HsLet (HsBinds id) -- let(rec)
+ | HsLet (HsLocalBinds id) -- let(rec)
(HsCmd id)
| HsDo (HsStmtContext Name) -- The parameterisation is unimportant
-- 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)
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
(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