diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-04-02 20:59:07 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-04-17 03:10:43 -0700 |
commit | 2483644374373f078826bf463f47152e0520f62b (patch) | |
tree | f5fe5a674824ba2ca293f02169c5c717dd655503 | |
parent | 51af102e5c6c56e0987432aa5a21fe10e24090e9 (diff) | |
download | haskell-2483644374373f078826bf463f47152e0520f62b.tar.gz |
Documentation for rnImports/rnImportDecl.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: comments only
Reviewers: simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D816
-rw-r--r-- | compiler/rename/RnNames.hs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 102deb0b4e..5541e8b79b 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -136,9 +136,10 @@ trust network' to get everything working. Due to this invasive nature of going with yes we have gone with no for now. -} --- | Process Import Decls --- Do the non SOURCE ones first, so that we get a helpful warning for SOURCE --- ones that are unnecessary +-- | Process Import Decls. See 'rnImportDecl' for a description of what +-- the return types represent. +-- Note: Do the non SOURCE ones first, so that we get a helpful warning +-- for SOURCE ones that are unnecessary rnImports :: [LImportDecl RdrName] -> RnM ([LImportDecl Name], GlobalRdrEnv, ImportAvails, AnyHpcUsage) rnImports imports = do @@ -163,6 +164,21 @@ rnImports imports = do imp_avails1 `plusImportAvails` imp_avails2, hpc_usage1 || hpc_usage2 ) +-- | Given a located import declaration @decl@ from @this_mod@, +-- calculate the following pieces of information: +-- +-- 1. An updated 'LImportDecl', where all unresolved 'RdrName' in +-- the entity lists have been resolved into 'Name's, +-- +-- 2. A 'GlobalRdrEnv' representing the new identifiers that were +-- brought into scope (taking into account module qualification +-- and hiding), +-- +-- 3. 'ImportAvails' summarizing the identifiers that were imported +-- by this declaration, and +-- +-- 4. A boolean 'AnyHpcUsage' which is true if the imported module +-- used HPC. rnImportDecl :: Module -> LImportDecl RdrName -> RnM (LImportDecl Name, GlobalRdrEnv, ImportAvails, AnyHpcUsage) rnImportDecl this_mod |