[commit: ghc] master: Clarify scope of `getQ`/`putQ` state. (d1f2239)

git at git.haskell.org git at git.haskell.org
Wed Aug 31 17:19:32 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d1f22396eec4be0a2101de6b7f7b780792acc0a9/ghc

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

commit d1f22396eec4be0a2101de6b7f7b780792acc0a9
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


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

d1f22396eec4be0a2101de6b7f7b780792acc0a9
 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 690ab98..1129239 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -465,11 +465,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