X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPprTyThing.hs;h=d58bd110923b487d29b214671f272ad23e2e9194;hb=3b1438a9757639d7f37f10e1237e2369ca0ebe4a;hp=a0bad30fd02ee27aada71031231a11ce13d9f156;hpb=37df27c6f21452c60c45b5cf6defc9003a41da15;p=ghc-hetmet.git diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index a0bad30..d58bd11 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -30,6 +30,7 @@ import TyCon ( tyConFamInst_maybe ) import Type ( pprTypeApp ) import GHC ( TyThing(..), SrcSpan ) import Var +import Name import Outputable -- ----------------------------------------------------------------------------- @@ -44,7 +45,7 @@ type PrintExplicitForalls = Bool pprTyThingLoc :: PrintExplicitForalls -> TyThing -> SDoc pprTyThingLoc pefas tyThing = showWithLoc loc (pprTyThing pefas tyThing) - where loc = GHC.nameSrcSpan (GHC.getName tyThing) + where loc = pprNameLoc (GHC.getName tyThing) -- | Pretty-prints a 'TyThing'. pprTyThing :: PrintExplicitForalls -> TyThing -> SDoc @@ -57,7 +58,7 @@ pprTyThing pefas (AClass cls) = pprClass pefas cls pprTyThingInContextLoc :: PrintExplicitForalls -> TyThing -> SDoc pprTyThingInContextLoc pefas tyThing = showWithLoc loc (pprTyThingInContext pefas tyThing) - where loc = GHC.nameSrcSpan (GHC.getName tyThing) + where loc = pprNameLoc (GHC.getName tyThing) -- | Pretty-prints a 'TyThing' in context: that is, if the entity -- is a data constructor, record selector, or class method, then @@ -241,9 +242,9 @@ add_bars (c:cs) = sep ((equals <+> c) : map (char '|' <+>) cs) ppr_bndr :: GHC.NamedThing a => a -> SDoc ppr_bndr a = GHC.pprParenSymName a -showWithLoc :: SrcSpan -> SDoc -> SDoc +showWithLoc :: SDoc -> SDoc -> SDoc showWithLoc loc doc - = hang doc 2 (char '\t' <> comment <+> GHC.pprDefnLoc loc) + = hang doc 2 (char '\t' <> comment <+> loc) -- The tab tries to make them line up a bit where comment = ptext SLIT("--")