summaryrefslogtreecommitdiff
path: root/ghc/compiler/rename/RnMonad.lhs
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-11-03 17:10:58 +0000
committersimonpj <unknown>2000-11-03 17:10:58 +0000
commitcd241c73f2b03a48d905e0db50c796eb0de45dec (patch)
tree3a008d05aa518384a7ecdcf612afa517e2573a83 /ghc/compiler/rename/RnMonad.lhs
parentb4ece1c1c408b94de94353604135549d4636fc0e (diff)
downloadhaskell-cd241c73f2b03a48d905e0db50c796eb0de45dec.tar.gz
[project @ 2000-11-03 17:10:57 by simonpj]
More renamer... not in a working state I fear
Diffstat (limited to 'ghc/compiler/rename/RnMonad.lhs')
-rw-r--r--ghc/compiler/rename/RnMonad.lhs27
1 files changed, 11 insertions, 16 deletions
diff --git a/ghc/compiler/rename/RnMonad.lhs b/ghc/compiler/rename/RnMonad.lhs
index a1b9d7732d..0d562d3114 100644
--- a/ghc/compiler/rename/RnMonad.lhs
+++ b/ghc/compiler/rename/RnMonad.lhs
@@ -40,7 +40,7 @@ import HscTypes ( AvailEnv, lookupType,
WhetherHasOrphans, ImportVersion,
PersistentRenamerState(..), IsBootInterface, Avails,
DeclsMap, IfaceInsts, IfaceRules,
- HomeSymbolTable, PackageTypeEnv,
+ HomeSymbolTable, TyThing,
PersistentCompilerState(..), GlobalRdrEnv,
HomeIfaceTable, PackageIfaceTable,
RdrAvailInfo )
@@ -67,7 +67,6 @@ import Bag ( Bag, emptyBag, isEmptyBag, snocBag )
import UniqSupply
import Outputable
import PrelNames ( mkUnboundName )
-import Maybes ( maybeToBool )
import ErrUtils ( printErrorsAndWarnings )
infixr 9 `thenRn`, `thenRn_`
@@ -127,11 +126,13 @@ data RnDown
rn_dflags :: DynFlags,
rn_hit :: HomeIfaceTable,
- rn_done :: Name -> Bool, -- Tells what things (both in the
- -- home package and other packages)
- -- were already available (i.e. in
- -- the relevant SymbolTable) before
- -- compiling this module
+ rn_done :: Name -> Maybe TyThing, -- Tells what things (both in the
+ -- home package and other packages)
+ -- were already available (i.e. in
+ -- the relevant SymbolTable) before
+ -- compiling this module
+ -- The Name passed to rn_done is guaranteed to be a Global,
+ -- so it has a Module, so it can be looked up
rn_errs :: IORef (Bag WarnMsg, Bag ErrMsg),
@@ -330,7 +331,7 @@ initRn dflags hit hst pcs mod do_rn
rn_dflags = dflags,
rn_hit = hit,
- rn_done = is_done hst pte,
+ rn_done = lookupType hst pte,
rn_ns = names_var,
rn_errs = errs_var,
@@ -358,11 +359,6 @@ initRn dflags hit hst pcs mod do_rn
return (new_pcs, not (isEmptyBag errs), res)
-is_done :: HomeSymbolTable -> PackageTypeEnv -> Name -> Bool
--- Returns True iff the name is in either symbol table
--- The name is a Global, so it has a Module
-is_done hst pte n = maybeToBool (lookupType hst pte n)
-
initRnMS rn_env fixity_env mode thing_inside rn_down g_down
-- The fixity_env appears in both the rn_fixenv field
-- and in the HIT. See comments with RnHiFiles.lookupFixityRn
@@ -589,9 +585,8 @@ getSrcLocRn down l_down
getHomeIfaceTableRn :: RnM d HomeIfaceTable
getHomeIfaceTableRn down l_down = return (rn_hit down)
-checkAlreadyAvailable :: Name -> RnM d Bool
- -- Name is a Global name
-checkAlreadyAvailable name down l_down = return (rn_done down name)
+getTypeEnvRn :: RnM d (Name -> Maybe TyThing)
+getTypeEnvRn down l_down = return (rn_done down)
\end{code}
%================