[commit: ghc] wip/T8776: Reinstate pretty-printing of AnIds via pprId (#8776) (ced09a6)

git at git.haskell.org git at git.haskell.org
Fri Mar 14 14:22:54 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T8776
Link       : http://ghc.haskell.org/trac/ghc/changeset/ced09a6a2923e4f49ff345d4a28ea11a3b28c4ad/ghc

>---------------------------------------------------------------

commit ced09a6a2923e4f49ff345d4a28ea11a3b28c4ad
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Fri Mar 14 22:17:45 2014 +0800

    Reinstate pretty-printing of AnIds via pprId (#8776)


>---------------------------------------------------------------

ced09a6a2923e4f49ff345d4a28ea11a3b28c4ad
 compiler/main/PprTyThing.hs |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs
index fb92b5a..1fd5d0c 100644
--- a/compiler/main/PprTyThing.hs
+++ b/compiler/main/PprTyThing.hs
@@ -104,6 +104,7 @@ pprTyThingHdr = ppr_ty_thing Nothing
 -- 'TyCon' tidying happening in 'tyThingToIfaceDecl'. See #8776 for details.
 ppr_ty_thing :: Maybe ShowSub -> TyThing -> SDoc
 ppr_ty_thing mss tyThing = case tyThing of
+    AnId id -> pprId id
     ATyCon tyCon -> case mss of
         Nothing -> pprTyConHdr tyCon
         Just ss -> pprTyCon ss tyCon
@@ -147,6 +148,11 @@ pprClassHdr cls
   where
      (tvs, funDeps) = classTvsFds cls
 
+pprId :: Var -> SDoc
+pprId ident
+  = hang (ppr_bndr ident <+> dcolon)
+	 2 (pprTypeForUser (idType ident))
+
 pprTypeForUser :: Type -> SDoc
 -- We do two things here.
 -- a) We tidy the type, regardless



More information about the ghc-commits mailing list