@@ -44,14 +44,15 @@ loadAllModules files = do
4444createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
4545createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =
4646 let
47− moduleName = P.ModuleName [P.ProperName "$PSCI"]
48− trace = P.Var (P.Qualified (Just supportModuleName) (P.Ident "eval"))
49− mainValue = P.App trace (P.Var (P.Qualified Nothing (P.Ident "it")))
50− itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
51− mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
52− decls = if exec then [itDecl, mainDecl] else [itDecl]
47+ moduleName = P.ModuleName [P.ProperName "$PSCI"]
48+ supportImport = (supportModuleName, P.Implicit, Just (P.ModuleName [P.ProperName "$Support"]))
49+ eval = P.Var (P.Qualified (Just (P.ModuleName [P.ProperName "$Support"])) (P.Ident "eval"))
50+ mainValue = P.App eval (P.Var (P.Qualified Nothing (P.Ident "it")))
51+ itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
52+ mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
53+ decls = if exec then [itDecl, mainDecl] else [itDecl]
5354 in
54− P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` imports) ++ lets ++ decls) Nothing
55+ P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` (supportImport : imports)) ++ lets ++ decls) Nothing
5556
5657
5758-- |