@@ -31,6 +31,8 @@ import Language.PureScript.Environment
3131import Language.PureScript.Errors
3232import Language.PureScript.Traversals
3333
34+import qualified Language.PureScript.Constants as C
35+
3436-- |
3537-- The global export environment - every declaration exported from every module.
3638--
@@ -272,7 +274,7 @@ renameInModule imports exports (Module mn decls exps) =
272274-- Finds all exported declarations in a set of modules.
273275--
274276findExports :: [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
276278 where
277279
278280 -- The exported types from the Prim module
@@ -385,7 +387,8 @@ resolveImports env (Module currentModule decls _) =
385387 -- module (where Nothing indicates everything is to be imported), and optionally a qualified name
386388 -- for the module
387389 scope :: M.Map ModuleName (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)
388− scope = M.insert currentModule (Nothing, Nothing, Nothing) (findImports decls)
390+ scope = M.insert (ModuleName [ProperName C.prim]) (Nothing, Nothing, Nothing) $
391+ M.insert currentModule (Nothing, Nothing, Nothing) (findImports decls)
389392
390393 resolveImport' :: ImportEnvironment -> (ModuleName, (Maybe SourcePos, Maybe ExplicitImports, Maybe ModuleName)) -> Either ErrorStack ImportEnvironment
391394 resolveImport' imp (mn, (pos, explImports, impQual)) = do