import Type ( pprTypeApp )
import GHC ( TyThing(..), SrcSpan )
import Var
+import Name
import Outputable
-- -----------------------------------------------------------------------------
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
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
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("--")