[commit: ghc] master,ghc-lwc2,type-nats: Fix the compiler plugin example; patch from edsko; fixes #7682 (cb34ce9)
Ian Lynagh
igloo at earth.li
Thu Feb 28 15:19:56 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branches: master,ghc-lwc2,type-nats
http://hackage.haskell.org/trac/ghc/changeset/cb34ce9dabb263c515e914461e65afdb258ae396
>---------------------------------------------------------------
commit cb34ce9dabb263c515e914461e65afdb258ae396
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Feb 24 16:20:04 2013 +0000
Fix the compiler plugin example; patch from edsko; fixes #7682
>---------------------------------------------------------------
docs/users_guide/extending_ghc.xml | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/docs/users_guide/extending_ghc.xml b/docs/users_guide/extending_ghc.xml
index 1bce3fa..2c7f021 100644
--- a/docs/users_guide/extending_ghc.xml
+++ b/docs/users_guide/extending_ghc.xml
@@ -226,12 +226,13 @@ install _ todo = do
return (CoreDoPluginPass "Say name" pass : todo)
pass :: ModGuts -> CoreM ModGuts
-pass = bindsOnlyPass (mapM printBind)
- where printBind :: CoreBind -> CoreM CoreBind
- printBind bndr@(NonRec b _) = do
- putMsgS $ "Non-recursive binding named " ++ showSDoc (ppr b)
+pass = do dflags <- getDynFlags
+ bindsOnlyPass (mapM (printBind dflags))
+ where printBind :: DynFlags -> CoreBind -> CoreM CoreBind
+ printBind dflags bndr@(NonRec b _) = do
+ putMsgS $ "Non-recursive binding named " ++ showSDoc dflags (ppr b)
return bndr
- printBind bndr = return bndr
+ printBind _ bndr = return bndr
</programlisting>
</sect3>
More information about the ghc-commits
mailing list