[commit: ghc] wip/annotate-core: Push varBinder annotations further in (ffb8f65)

git at git.haskell.org git at git.haskell.org
Wed Aug 9 15:27:20 UTC 2017


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

On branch  : wip/annotate-core
Link       : http://ghc.haskell.org/trac/ghc/changeset/ffb8f654d22bd3c2ef5ad497665a0a73938bee88/ghc

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

commit ffb8f654d22bd3c2ef5ad497665a0a73938bee88
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Wed Aug 9 14:34:34 2017 +0000

    Push varBinder annotations further in


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

ffb8f654d22bd3c2ef5ad497665a0a73938bee88
 compiler/coreSyn/PprCore.hs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs
index d4ae498..2b001d9 100644
--- a/compiler/coreSyn/PprCore.hs
+++ b/compiler/coreSyn/PprCore.hs
@@ -349,7 +349,7 @@ binders are printed as "_".
 -- These instances are sadly orphans
 
 instance OutputableBndr Var where
-  pprBndr bs b = addAnn (varBinder b) (pprCoreBinder bs b)
+  pprBndr bs b = pprCoreBinder bs b
   pprInfixOcc b = addAnn (varReference b) (pprInfixName  (varName b))
   pprPrefixOcc b = addAnn (varReference b) (pprPrefixName (varName b))
   bndrIsJoin_maybe = isJoinId_maybe
@@ -373,7 +373,7 @@ pprCoreBinder bind_site bndr
 
 pprUntypedBinder :: Var -> SDoc
 pprUntypedBinder binder
-  | isTyVar binder = text "@" <+> ppr binder    -- NB: don't print kind
+  | isTyVar binder = text "@" <+> addAnn (varBinder binder) (ppr binder)    -- NB: don't print kind
   | otherwise      = pprIdBndr binder
 
 pprTypedLamBinder :: BindingSite -> Bool -> Var -> SDoc
@@ -423,12 +423,12 @@ pprTypedLetBinder binder
 pprKindedTyVarBndr :: TyVar -> SDoc
 -- Print a type variable binder with its kind (but not if *)
 pprKindedTyVarBndr tyvar
-  = text "@" <+> pprTyVar tyvar
+  = text "@" <+> addAnn (varBinder tyvar) (pprTyVar tyvar)
 
 -- pprIdBndr does *not* print the type
 -- When printing any Id binder in debug mode, we print its inline pragma and one-shot-ness
 pprIdBndr :: Id -> SDoc
-pprIdBndr id = ppr id <+> pprIdBndrInfo (idInfo id)
+pprIdBndr id = addAnn (varBinder id) (ppr id) <+> pprIdBndrInfo (idInfo id)
 
 pprIdBndrInfo :: IdInfo -> SDoc
 pprIdBndrInfo info



More information about the ghc-commits mailing list