[commit: ghc] ghc-7.8: Reinstate pretty-printing of AnIds via pprId (#8776) (8d29dbe)

git at git.haskell.org git at git.haskell.org
Sat Mar 22 19:38:31 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/8d29dbea3afc6e94ec3a13f7beb2f86a8e87ab5e/ghc

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

commit 8d29dbea3afc6e94ec3a13f7beb2f86a8e87ab5e
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)
    
    (cherry picked from commit 52003696ff7a2bbf86fbfccfe29b9f146a1ea549)


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

8d29dbea3afc6e94ec3a13f7beb2f86a8e87ab5e
 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