@@ -45,14 +45,27 @@ createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
45createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =
45createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =
47 moduleName = P.ModuleName [P.ProperName "$PSCI"]
47 moduleName = P.ModuleName [P.ProperName "$PSCI"]
48+ effModuleName = P.moduleNameFromString "Control.Monad.Eff"
49+ effImport = (effModuleName, P.Implicit, Just (P.ModuleName [P.ProperName "$Eff"]))
48 supportImport = (supportModuleName, P.Implicit, Just (P.ModuleName [P.ProperName "$Support"]))
50 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"))
51 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")))
52 mainValue = P.App eval (P.Var (P.Qualified Nothing (P.Ident "it")))
51 itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
53 itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
54+ typeDecl = P.TypeDeclaration (P.Ident "$main")
58+ (P.Qualified (Just (P.ModuleName [P.ProperName "$Eff"])) (P.ProperName "Eff")))
59+ (P.TypeWildcard internalSpan))
60+ (P.TypeWildcard internalSpan))
52 mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
61 mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
53− decls = if exec then [itDecl, mainDecl] else [itDecl]
62+ decls = if exec then [itDecl, typeDecl, mainDecl] else [itDecl]
63+ internalSpan = P.internalModuleSourceSpan "<internal>"
65+ P.Module internalSpan
55− P.Module (P.internalModuleSourceSpan "<internal>") [] moduleName ((importDecl `map` (supportImport : imports)) ++ lets ++ decls) Nothing
67+ ((importDecl `map` (effImport : supportImport : imports)) ++ lets ++ decls)