Tidy up pretty-printing (use ppUnless)
authorsimonpj@microsoft.com <unknown>
Thu, 29 Oct 2009 12:16:01 +0000 (12:16 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 29 Oct 2009 12:16:01 +0000 (12:16 +0000)
compiler/hsSyn/HsExpr.lhs
compiler/hsSyn/HsPat.lhs

index c3f38ca..6530ad6 100644 (file)
@@ -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
index c886766..af921de 100644 (file)
@@ -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
 --