Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
60beff5f
Commit
60beff5f
authored
Feb 04, 2003
by
simonpj
Browse files
[project @ 2003-02-04 12:25:21 by simonpj]
Use nameIsLocalOrFrom instead of open code
parent
23a4e1f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/rename/RnIfaces.lhs
View file @
60beff5f
...
...
@@ -34,8 +34,8 @@ import FieldLabel ( fieldLabelTyCon )
import DataCon ( dataConTyCon )
import TyCon ( visibleDataCons, isSynTyCon, getSynTyConDefn, tyConClass_maybe, tyConName )
import Class ( className, classSCTheta )
import Name ( Name {-instance NamedThing-}, isWiredInName,
isInternalName, nameModule, NamedThing(..)
)
import Name ( Name {-instance NamedThing-}, isWiredInName,
nameIsLocalOrFrom,
nameModule, NamedThing(..)
)
import NameEnv ( delFromNameEnv, lookupNameEnv )
import NameSet
import Module ( Module, isHomeModule )
...
...
@@ -233,7 +233,7 @@ importDecl already_slurped name
= -- STEP 0: Check if it's from this module
-- Doing this catches a common case quickly
getModule `thenM` \ this_mod ->
if
isInternalName name || nameModule name ==
this_mod then
if
nameIsLocalOrFrom
this_mod
name
then
-- Variables defined on the GHCi command line (e.g. let x = 3)
-- are Internal names (which don't have a Module)
returnM AlreadySlurped
...
...
@@ -535,8 +535,7 @@ getImportedRules slurped
| otherwise
= getEps `thenM` \ eps ->
getInGlobalScope `thenM` \ in_type_env ->
let
-- Slurp rules for anything that is slurped,
let -- Slurp rules for anything that is slurped,
-- either now, or previously
available n = n `elemNameSet` slurped || in_type_env n
(decls, new_rules) = selectGated available (eps_rules eps)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment