X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPprTyThing.hs;h=d58bd110923b487d29b214671f272ad23e2e9194;hb=0c45d82423fcff64b43b95ab4882b26e7de560bf;hp=8c6e6962785fbab63c770a19bc614ad069ddb11e;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index 8c6e696..d58bd11 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -6,11 +6,11 @@ -- ----------------------------------------------------------------------------- -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module PprTyThing ( @@ -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("--")