= vcat [ppr_isrec,
vcat (map ppr sigs),
vcat (map ppr (bagToList binds))
+ -- *not* pprLHsBinds because we don't want braces; 'let' and
+ -- 'where' include a list of HsBindGroups and we don't want
+ -- several groups of bindings each with braces around.
]
where
ppr_isrec = getPprStyle $ \ sty ->
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)]