[commit: ghc] ghc-8.0: Clarify scope of `getQ`/`putQ` state. (730809f)

git at git.haskell.org git at git.haskell.org
Wed Aug 31 23:23:35 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/730809f018bb6fb8f6c14a6da3f4d78b395f9ccb/ghc

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

commit 730809f018bb6fb8f6c14a6da3f4d78b395f9ccb
Author: Francesco Mazzoli <f at mazzo.li>
Date:   Tue Aug 30 17:09:16 2016 -0400

    Clarify scope of `getQ`/`putQ` state.
    
    The current haddocks do not specify the scope of the state manipulated
    by `getQ`/`putQ`.
    
    Reviewers: austin, goldfire, bgamari, ezyang
    
    Reviewed By: ezyang
    
    Subscribers: ezyang, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2497
    
    (cherry picked from commit d1f22396eec4be0a2101de6b7f7b780792acc0a9)


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

730809f018bb6fb8f6c14a6da3f4d78b395f9ccb
 libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 5b35127..ec6e1ca 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -478,11 +478,13 @@ addTopDecls ds = Q (qAddTopDecls ds)
 addModFinalizer :: Q () -> Q ()
 addModFinalizer act = Q (qAddModFinalizer (unQ act))
 
--- | Get state from the 'Q' monad.
+-- | Get state from the 'Q' monad. Note that the state is local to the
+-- Haskell module in which the Template Haskell expression is executed.
 getQ :: Typeable a => Q (Maybe a)
 getQ = Q qGetQ
 
--- | Replace the state in the 'Q' monad.
+-- | Replace the state in the 'Q' monad. Note that the state is local to the
+-- Haskell module in which the Template Haskell expression is executed.
 putQ :: Typeable a => a -> Q ()
 putQ x = Q (qPutQ x)
 



More information about the ghc-commits mailing list