X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPprTyThing.hs;h=4b309b615d724f72d12b922862af422099c1a4a4;hb=bda0a4f655b2f9892d2778b0ab1b5d437c392226;hp=025004f805bd31bace2b7d1001d583dd982493c8;hpb=70918cf4a4d61d4752b18f29ce14c7d7f1fbce01;p=ghc-hetmet.git diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index 025004f..4b309b6 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -20,7 +20,7 @@ import qualified GHC import TyCon ( tyConFamInst_maybe ) import Type ( pprTypeApp ) -import GHC ( TyThing(..), SrcLoc ) +import GHC ( TyThing(..), SrcSpan ) import Outputable -- ----------------------------------------------------------------------------- @@ -33,7 +33,7 @@ import Outputable pprTyThingLoc :: Bool -> TyThing -> SDoc pprTyThingLoc exts tyThing = showWithLoc loc (pprTyThing exts tyThing) - where loc = GHC.nameSrcLoc (GHC.getName tyThing) + where loc = GHC.nameSrcSpan (GHC.getName tyThing) -- | Pretty-prints a 'TyThing'. pprTyThing :: Bool -> TyThing -> SDoc @@ -46,7 +46,7 @@ pprTyThing exts (AClass cls) = pprClass exts cls pprTyThingInContextLoc :: Bool -> TyThing -> SDoc pprTyThingInContextLoc exts tyThing = showWithLoc loc (pprTyThingInContext exts tyThing) - where loc = GHC.nameSrcLoc (GHC.getName tyThing) + where loc = GHC.nameSrcSpan (GHC.getName tyThing) -- | Pretty-prints a 'TyThing' in context: that is, if the entity -- is a data constructor, record selector, or class method, then @@ -69,7 +69,7 @@ pprTyThingHdr exts (AClass cls) = pprClassHdr exts cls pprTyConHdr exts tyCon | Just (fam_tc, tys) <- tyConFamInst_maybe tyCon - = ptext keyword <+> ptext SLIT("instance") <+> pprTypeApp (ppr_bndr tyCon) tys + = ptext keyword <+> ptext SLIT("instance") <+> pprTypeApp tyCon (ppr_bndr tyCon) tys | otherwise = ptext keyword <+> opt_family <+> ppr_bndr tyCon <+> hsep (map ppr vars) where @@ -228,7 +228,7 @@ add_bars (c:cs) = sep ((equals <+> c) : map (char '|' <+>) cs) ppr_bndr :: GHC.NamedThing a => a -> SDoc ppr_bndr a = GHC.pprParenSymName a -showWithLoc :: SrcLoc -> SDoc -> SDoc +showWithLoc :: SrcSpan -> SDoc -> SDoc showWithLoc loc doc = hang doc 2 (char '\t' <> comment <+> GHC.pprDefnLoc loc) -- The tab tries to make them line up a bit