File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
src/Language/PureScript/Interactive Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,27 @@ createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
4545createTemporaryModule exec PSCiState {psciImportedModules = imports, psciLetBindings = lets} val =
4646 let
4747 moduleName = P. ModuleName [P. ProperName " $PSCI" ]
48+ effModuleName = P. moduleNameFromString " Control.Monad.Eff"
49+ effImport = (effModuleName, P. Implicit , Just (P. ModuleName [P. ProperName " $Eff" ]))
4850 supportImport = (supportModuleName, P. Implicit , Just (P. ModuleName [P. ProperName " $Support" ]))
4951 eval = P. Var (P. Qualified (Just (P. ModuleName [P. ProperName " $Support" ])) (P. Ident " eval" ))
5052 mainValue = P. App eval (P. Var (P. Qualified Nothing (P. Ident " it" )))
5153 itDecl = P. ValueDeclaration (P. Ident " it" ) P. Public [] $ Right val
54+ typeDecl = P. TypeDeclaration (P. Ident " $main" )
55+ (P. TypeApp
56+ (P. TypeApp
57+ (P. TypeConstructor
58+ (P. Qualified (Just (P. ModuleName [P. ProperName " $Eff" ])) (P. ProperName " Eff" )))
59+ (P. TypeWildcard internalSpan))
60+ (P. TypeWildcard internalSpan))
5261 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>"
5464 in
55- P. Module (P. internalModuleSourceSpan " <internal>" ) [] moduleName ((importDecl `map` (supportImport : imports)) ++ lets ++ decls) Nothing
65+ P. Module internalSpan
66+ [] moduleName
67+ ((importDecl `map` (effImport : supportImport : imports)) ++ lets ++ decls)
68+ Nothing
5669
5770
5871-- |
You can’t perform that action at this time.
0 commit comments