Hi all,
I was fiddling with ghc/compiler/deSugar/DsMeta.hs and expected
something like the attached patch to work (I think just the one file
should suffice - cONTROL_MONAD_Name doesn't exist in PrelNames but isn't
actually used). When compiling a test program the output of
-ddump-rn-trace looked plausible to my untrained eye, but the compile
failed with:
-----8<----------8<----------8<-----
ghc-5.05: chasing modules from: mb
Compiling Main ( mb.lhs, ./mb.o )
mb.lhs:3:
Failed to find interface decl for `GHC.Base.>>='
from module `GHC.Base'
mb.lhs:3:
Failed to find interface decl for `GHC.Base.>>='
from module `GHC.Base'
mb.lhs:21:
tcLookup: `GHC.Base.>>=' is not in scope
In a right-hand side of function `main':
do
putStrLn "foo"
return ()
In the definition of `main':
main = do
putStrLn "foo"
return ()
mb.lhs:38: tcLookup: `GHC.Base.>>=' is not in scope
-----8<----------8<----------8<-----
Any clues?
Thanks
Ian
Index: cvs/ghc/compiler/deSugar/DsMeta.hs
===================================================================
RCS file: /cvs/fptools/ghc/compiler/deSugar/DsMeta.hs,v
retrieving revision 1.21
diff -u -r1.21 DsMeta.hs
--- cvs/ghc/compiler/deSugar/DsMeta.hs 2002/11/13 09:57:02 1.21
+++ cvs/ghc/compiler/deSugar/DsMeta.hs 2002/11/17 18:29:39
@@ -42,7 +42,8 @@
toHsType
)
-import PrelNames ( mETA_META_Name, rationalTyConName, negateName,
+import PrelNames ( mETA_META_Name, cONTROL_MONAD_Name, bindMName, pREL_BASE_Name,
+ rationalTyConName, negateName,
parrTyConName )
import MkIface ( ifaceTyThing )
import Name ( Name, nameOccName, nameModule )
@@ -1118,15 +1119,18 @@
decTyConName, typTyConName ]
-varQual = mk_known_key_name OccName.varName
-tcQual = mk_known_key_name OccName.tcName
+monadVarQual = mk_known_key_name monadModule OccName.varName
+varQual = mk_known_key_name thModule OccName.varName
+tcQual = mk_known_key_name thModule OccName.tcName
-thModule :: Module
+thModule, monadModule :: Module
-- NB: the THSyntax module comes from the "haskell-src" package
thModule = mkThPkgModule mETA_META_Name
+monadModule = mkThPkgModule pREL_BASE_Name
+-- monadModule = mkThPkgModule cONTROL_MONAD_Name
-mk_known_key_name space str uniq
- = mkKnownKeyExternalName thModule (mkOccFS space str) uniq
+mk_known_key_name mod space str uniq
+ = mkKnownKeyExternalName mod (mkOccFS space str) uniq
integerLName = varQual FSLIT("integerL") integerLIdKey
charLName = varQual FSLIT("charL") charLIdKey
@@ -1168,8 +1172,13 @@
fromThenToName = varQual FSLIT("fromThenTo") fromThenToIdKey
liftName = varQual FSLIT("lift") liftIdKey
gensymName = varQual FSLIT("gensym") gensymIdKey
+-- returnQName = monadVarQual FSLIT("return") returnQIdKey
+-- returnQName = monadVarQual FSLIT("chr") returnQIdKey
+bindQName = monadVarQual FSLIT(">>=") bindQIdKey
+-- bindQName = bindMName
+-- sequenceQName = monadVarQual FSLIT("sequence") sequenceQIdKey
returnQName = varQual FSLIT("returnQ") returnQIdKey
-bindQName = varQual FSLIT("bindQ") bindQIdKey
+-- bindQName = varQual FSLIT("bindQ") bindQIdKey
sequenceQName = varQual FSLIT("sequenceQ") sequenceQIdKey
-- type Mat = ...