diff options
| author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-03-28 10:20:44 -0700 |
|---|---|---|
| committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-04-02 16:43:47 -0700 |
| commit | 0c333c89ffce5c271d3123e612c7ae22a810649e (patch) | |
| tree | 060df0e0d0d1f6a714062358f2b7a1fc84711cff | |
| parent | 71dadd71e7bb397a05b45c45d679139b08f76598 (diff) | |
| download | haskell-0c333c89ffce5c271d3123e612c7ae22a810649e.tar.gz | |
Extra docs on tcg_imports.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
| -rw-r--r-- | compiler/typecheck/TcRnTypes.hs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index b6443340fd..90423e42be 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -531,7 +531,31 @@ data TcGblEnv tcg_imports :: ImportAvails, -- ^ Information about what was imported from where, including -- things bound in this module. Also store Safe Haskell info - -- here about transative trusted packaage requirements. + -- here about transitive trusted package requirements. + -- + -- There are not many uses of this field, so you can grep for + -- all them. + -- + -- The ImportAvails records information about the following + -- things: + -- + -- 1. All of the modules you directly imported (tcRnImports) + -- 2. The orphans (only!) of all imported modules in a GHCi + -- session (runTcInteractive) + -- 3. The module that instantiated a signature + -- 4. Each of the signatures that merged in + -- + -- It is used in the following ways: + -- - imp_orphs is used to determine what orphan modules should be + -- visible in the context (tcVisibleOrphanMods) + -- - imp_finsts is used to determine what family instances should + -- be visible (tcExtendLocalFamInstEnv) + -- - To resolve the meaning of the export list of a module + -- (tcRnExports) + -- - imp_mods is used to compute usage info (mkIfaceTc, deSugar) + -- - imp_trust_own_pkg is used for Safe Haskell in interfaces + -- (mkIfaceTc, as well as in HscMain) + -- - To create the Dependencies field in interface (mkDependencies) tcg_dus :: DefUses, -- ^ What is defined in this module and what is used. tcg_used_gres :: TcRef [GlobalRdrElt], -- ^ Records occurrences of imported entities |
