ppr (HsBindGroup binds sigs is_rec)
= vcat [ppr_isrec,
vcat (map ppr sigs),
- vcat (map ppr (bagToList binds))
+ pprLHsBinds binds
]
where
ppr_isrec = getPprStyle $ \ sty ->
ppr (HsIPBinds ipbinds)
= vcat (map ppr ipbinds)
-mkHsBindGroup :: RecFlag -> Bag (LHsBind id) -> HsBindGroup id
-mkHsBindGroup is_rec mbinds = HsBindGroup mbinds [] is_rec
-
-- -----------------------------------------------------------------------------
-- Implicit parameter bindings
type LHsBinds id = Bag (LHsBind id)
type LHsBind id = Located (HsBind id)
+pprLHsBinds :: OutputableBndr id => LHsBinds id -> SDoc
+pprLHsBinds binds = lbrace <+> vcat (map ppr (bagToList binds)) <+> rbrace
+
data HsBind id
= FunBind (Located id)
-- Used for both functions f x = e
nest 4 ( vcat [pprBndr LetBind x | (_,x,_) <- exports]
-- Print type signatures
$$
- ppr val_binds )
+ pprLHsBinds val_binds )
\end{code}
%************************************************************************
\end{code}
\begin{code}
-instance (Outputable name) => Outputable (Sig name) where
+instance (OutputableBndr name) => Outputable (Sig name) where
ppr sig = ppr_sig sig
-ppr_sig :: Outputable name => Sig name -> SDoc
+ppr_sig :: OutputableBndr name => Sig name -> SDoc
ppr_sig (Sig var ty)
= sep [ppr var <+> dcolon, nest 4 (ppr ty)]