[commit: ghc] ghc-7.8: Add OutputableBndr instance for OccName (db6c7a9)

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


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

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

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

commit db6c7a97139512312cecb732a3c2973d51d199d9
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Wed Mar 12 20:37:22 2014 +0800

    Add OutputableBndr instance for OccName
    
    (cherry picked from commit 4d1b7b4a9b986e87755784478b4ea4883a5e203e)


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

db6c7a97139512312cecb732a3c2973d51d199d9
 compiler/basicTypes/OccName.lhs |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs
index 6dbae4b..d53292b 100644
--- a/compiler/basicTypes/OccName.lhs
+++ b/compiler/basicTypes/OccName.lhs
@@ -261,6 +261,11 @@ instance Data OccName where
 instance Outputable OccName where
     ppr = pprOccName
 
+instance OutputableBndr OccName where
+    pprBndr _ = ppr
+    pprInfixOcc n = pprInfixVar (isSymOcc n) (ppr n)
+    pprPrefixOcc n = pprPrefixVar (isSymOcc n) (ppr n)
+
 pprOccName :: OccName -> SDoc
 pprOccName (OccName sp occ) 
   = getPprStyle $ \ sty ->



More information about the ghc-commits mailing list