@@ -31,6 +31,8 @@ import Language.PureScript.Environment
31import Language.PureScript.Errors
31import Language.PureScript.Errors
32import Language.PureScript.Traversals
32import Language.PureScript.Traversals
34+import qualified Language.PureScript.Constants as C
35-- The global export environment - every declaration exported from every module.
37-- The global export environment - every declaration exported from every module.
@@ -272,7 +274,7 @@ renameInModule imports exports (Module mn decls exps) =
272-- Finds all exported declarations in a set of modules.
274-- Finds all exported declarations in a set of modules.
274findExports :: [Module] -> Either ErrorStack ExportEnvironment
276findExports :: [Module] -> Either ErrorStack ExportEnvironment
275−findExports = foldM addModule $ M.singleton (ModuleName [ProperName "Prim"]) primExports
277+findExports = foldM addModule $ M.singleton (ModuleName [ProperName C.prim]) primExports
278 -- The exported types from the Prim module
280 -- The exported types from the Prim module
@@ -385,7 +387,8 @@ resolveImports env (Module currentModule decls _) =
385 -- module (where Nothing indicates everything is to be imported), and optionally a qualified name
387 -- module (where Nothing indicates everything is to be imported), and optionally a qualified name
386 -- for the module
388 -- for the module
387 scope :: M.Map ModuleName (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)
389 scope :: M.Map ModuleName (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)
390+ scope = M.insert (ModuleName [ProperName C.prim]) (Nothing, Nothing, Nothing) $
388− scope = M.insert currentModule (Nothing, Nothing, Nothing) (findImports decls)
391+ M.insert currentModule (Nothing, Nothing, Nothing) (findImports decls)
390 resolveImport' :: ImportEnvironment -> (ModuleName, (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)) -> Either ErrorStack ImportEnvironment
393 resolveImport' :: ImportEnvironment -> (ModuleName, (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)) -> Either ErrorStack ImportEnvironment
391 resolveImport' imp (mn, (pos, explImports, impQual)) = do
394 resolveImport' imp (mn, (pos, explImports, impQual)) = do