[commit: ghc] master: Reinstate pretty-printing of AnIds via pprId (#8776) (5200369)

git at git.haskell.org git at git.haskell.org
Fri Mar 14 14:26:09 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/52003696ff7a2bbf86fbfccfe29b9f146a1ea549/ghc

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

commit 52003696ff7a2bbf86fbfccfe29b9f146a1ea549
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)


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

52003696ff7a2bbf86fbfccfe29b9f146a1ea549
 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