summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Types.hs')
-rw-r--r--compiler/GHC/Tc/Types.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs
index 0003a93169..2c9be13dff 100644
--- a/compiler/GHC/Tc/Types.hs
+++ b/compiler/GHC/Tc/Types.hs
@@ -55,7 +55,7 @@ module GHC.Tc.Types(
ThStage(..), SpliceType(..), PendingStuff(..),
topStage, topAnnStage, topSpliceStage,
ThLevel, impLevel, outerLevel, thLevel,
- ForeignSrcLang(..),
+ ForeignSrcLang(..), THDocs, DocLoc(..),
-- Arrows
ArrowCtxt(..),
@@ -522,6 +522,9 @@ data TcGblEnv
tcg_th_remote_state :: TcRef (Maybe (ForeignRef (IORef QState))),
-- ^ Template Haskell state
+ tcg_th_docs :: TcRef THDocs,
+ -- ^ Docs added in Template Haskell via @putDoc@.
+
tcg_ev_binds :: Bag EvBind, -- Top-level evidence bindings
-- Things defined in this module, or (in GHCi)
@@ -1738,3 +1741,15 @@ lintGblEnv logger dflags tcg_env =
liftIO $ lintAxioms logger dflags (text "TcGblEnv axioms") axioms
where
axioms = typeEnvCoAxioms (tcg_type_env tcg_env)
+
+-- | This is a mirror of Template Haskell's DocLoc, but the TH names are
+-- resolved to GHC names.
+data DocLoc = DeclDoc Name
+ | ArgDoc Name Int
+ | InstDoc Name
+ | ModuleDoc
+ deriving (Eq, Ord)
+
+-- | The current collection of docs that Template Haskell has built up via
+-- putDoc.
+type THDocs = Map DocLoc String