-- friends:
import HsBinds ( HsBinds, MonoBinds, Sig(..), FixitySig(..) )
import HsExpr ( HsExpr )
+import HsImpExp ( ppr_var )
import HsTypes
import PprCore ( pprCoreRule )
import HsCore ( UfExpr, UfBinder, HsIdInfo, pprHsIdInfo,
import Util ( eqListBy )
import SrcLoc ( SrcLoc )
import FastString
+
+import Maybe ( isNothing, fromJust )
\end{code}
=> Outputable (TyClDecl name pat) where
ppr (IfaceSig {tcdName = var, tcdType = ty, tcdIdInfo = info})
- = hsep [ppr var, dcolon, ppr ty, pprHsIdInfo info]
+ = getPprStyle $ \ sty ->
+ hsep [ if ifaceStyle sty then ppr var else ppr_var var,
+ dcolon, ppr ty, pprHsIdInfo info
+ ]
ppr (ForeignType {tcdName = tycon})
= hsep [ptext SLIT("foreign import type dotnet"), ppr tycon]
where
top_matter = ptext SLIT("class") <+> pp_decl_head context clas tyvars <+> pprFundeps fds
ppr_sig sig = ppr sig <> semi
+
pp_methods = getPprStyle $ \ sty ->
- if ifaceStyle sty then empty else ppr methods
+ if ifaceStyle sty || isNothing methods
+ then empty
+ else ppr (fromJust methods)
pp_decl_head :: Outputable name => HsContext name -> name -> [HsTyVarBndr name] -> SDoc
pp_decl_head context thing tyvars = hsep [pprHsContext context, ppr thing, interppSP tyvars]
= ppr con <+> hsep (map (ppr_bang) tys)
ppr_con_details con (RecCon fields)
- = ppr con <+> braces (hsep (punctuate comma (map ppr_field fields)))
+ = ppr con <+> braces (sep (punctuate comma (map ppr_field fields)))
where
ppr_field (ns, ty) = hsep (map (ppr) ns) <+>
dcolon <+>