diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-02-24 16:20:04 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-02-24 16:20:04 +0000 |
commit | cb34ce9dabb263c515e914461e65afdb258ae396 (patch) | |
tree | 299e7b2469de52415671a712c92e951e6ffefe97 /docs/users_guide | |
parent | e2bea6019fd523d4b6061174b114c49f55fa981c (diff) | |
download | haskell-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.xml | 11 |
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 <- 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> |