Commit c7517d84 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Tidy up pretty-printing (use ppUnless)

parent 11f6e48e
......@@ -777,8 +777,8 @@ pprGRHSs :: (OutputableBndr idL, OutputableBndr idR)
=> HsMatchContext idL -> GRHSs idR -> SDoc
pprGRHSs ctxt (GRHSs grhss binds)
= vcat (map (pprGRHS ctxt . unLoc) grhss)
$$ if isEmptyLocalBinds binds then empty
else text "where" $$ nest 4 (pprBinds binds)
$$ ppUnless (isEmptyLocalBinds binds)
(text "where" $$ nest 4 (pprBinds binds))
pprGRHS :: (OutputableBndr idL, OutputableBndr idR)
=> HsMatchContext idL -> GRHS idR -> SDoc
......
......@@ -310,7 +310,7 @@ instance (OutputableBndr id, Outputable arg)
=> Outputable (HsRecField id arg) where
ppr (HsRecField { hsRecFieldId = f, hsRecFieldArg = arg,
hsRecPun = pun })
= ppr f <+> (if pun then empty else equals <+> ppr arg)
= ppr f <+> (ppUnless pun $ equals <+> ppr arg)
-- add parallel array brackets around a document
--
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment