[GHC] #7682: Plugin example not updated for ghc 7.6
#7682: Plugin example not updated for ghc 7.6 -----------------------------+---------------------------------------------- Reporter: edsko | Owner: Type: bug | Status: new Priority: normal | Component: Documentation Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- The GHC plugin docs (http://www.haskell.org/ghc/docs/latest/html/users_guide/compiler- plugins.html) have this example: {{{ 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) return bndr printBind bndr = return bndr }}} but in ghc >= 7.6 `showSDoc` requires `DynFlags`: {{{ pass :: ModGuts -> CoreM ModGuts pass guts = do dynFlags <- getDynFlags bindsOnlyPass (mapM $ printBind dynFlags) guts where printBind :: DynFlags -> CoreBind -> CoreM CoreBind printBind _dynFlags bndr@(NonRec b _) = do #if __GLASGOW_HASKELL__ >= 706 putMsgS $ "Non-recursive binding named " ++ showSDoc _dynFlags (ppr b) #else putMsgS $ "Non-recursive binding named " ++ showSDoc (ppr b) #endif return bndr printBind _dynFlags bndr = return bndr }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7682> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7682: Plugin example not updated for ghc 7.6 -----------------------------+---------------------------------------------- Reporter: edsko | Owner: Type: bug | Status: new Priority: normal | Component: Documentation Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by ian@…): commit cb34ce9dabb263c515e914461e65afdb258ae396 {{{ Author: Ian Lynagh <ian@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 files changed, 6 insertions(+), 5 deletions(-) }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7682#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7682: Plugin example not updated for ghc 7.6 -------------------------------+-------------------------------------------- Reporter: edsko | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Documentation | Version: 7.6.2 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * status: new => closed * difficulty: => Unknown * resolution: => fixed Comment: Fixed, thanks -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7682#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC