summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsonsmatt <parsonsmatt@gmail.com>2021-05-05 17:40:34 -0600
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-29 05:05:18 -0400
commit99b5cce97dd56dbf993b9a12ebc6c126a100a780 (patch)
tree5034a7f958537e3b7d530f6e48dcb7c07796e471
parent6412bf6e1e8c70ae96203190f460be243d961c59 (diff)
downloadhaskell-99b5cce97dd56dbf993b9a12ebc6c126a100a780.tar.gz
Address review comments, export from TH
-rw-r--r--libraries/template-haskell/Language/Haskell/TH.hs1
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs5
-rw-r--r--libraries/template-haskell/changelog.md3
3 files changed, 8 insertions, 1 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index 83432c14e3..14b37e8c12 100644
--- a/libraries/template-haskell/Language/Haskell/TH.hs
+++ b/libraries/template-haskell/Language/Haskell/TH.hs
@@ -22,6 +22,7 @@ module Language.Haskell.TH(
-- *** Reify
reify, -- :: Name -> Q Info
reifyModule,
+ addDeclarationGroup,
Info(..), ModuleInfo(..),
InstanceDec,
ParentName,
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 4e0ceb4eef..37ad1af7bf 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -532,7 +532,10 @@ Qualified names are also supported, like so:
-}
-{- | 'reify' looks up information about the 'Name'.
+{- | 'reify' looks up information about the 'Name'. It will fail with
+a compile error if the 'Name' is not visible. A 'Name' is visible if it is
+imported or defined in a prior top-level declaration group. See the
+documentation for 'newDeclarationGroup' for more details.
It is sometimes useful to construct the argument name using 'lookupTypeName' or 'lookupValueName'
to ensure that we are reifying from the right namespace. For instance, in this context:
diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md
index 7fc538b8cf..39d1c04c3f 100644
--- a/libraries/template-haskell/changelog.md
+++ b/libraries/template-haskell/changelog.md
@@ -14,6 +14,9 @@
`withDecDoc`/`withDecsDoc` as well as `_doc` counterparts to many of the
`Dec` helper functions.
+ * Add `newDeclarationGroup` to document the effect of visibility while
+ reifying types and instances.
+
## 2.17.0.0
* Typed Quotations now return a value of type `Code m a` (GHC Proposal #195).
The main motiviation is to make writing instances easier and make it easier to