diff options
author | Francesco Mazzoli <f@mazzo.li> | 2016-08-30 17:09:16 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-08-31 13:15:33 -0400 |
commit | d1f22396eec4be0a2101de6b7f7b780792acc0a9 (patch) | |
tree | c1255b29f9c8abec8c4aaa416ce7f864e6857553 /libraries/template-haskell | |
parent | d40d6df74a9fca382a84709ac9bc862897fbec18 (diff) | |
download | haskell-d1f22396eec4be0a2101de6b7f7b780792acc0a9.tar.gz |
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
Diffstat (limited to 'libraries/template-haskell')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 6 |
1 files 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 690ab98a16..1129239960 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) |