summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-02-24 16:20:04 +0000
committerIan Lynagh <ian@well-typed.com>2013-02-24 16:20:04 +0000
commitcb34ce9dabb263c515e914461e65afdb258ae396 (patch)
tree299e7b2469de52415671a712c92e951e6ffefe97 /docs/users_guide
parente2bea6019fd523d4b6061174b114c49f55fa981c (diff)
downloadhaskell-cb34ce9dabb263c515e914461e65afdb258ae396.tar.gz
Fix the compiler plugin example; patch from edsko; fixes #7682
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/extending_ghc.xml11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/users_guide/extending_ghc.xml b/docs/users_guide/extending_ghc.xml
index 1bce3fa7b4..2c7f0210a8 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 &lt;- 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>