git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix PSCi imports
c50718bPhil Freeman
src/Language/PureScript/Interactive/Module.hs+8−7
@@ -44,14 +44,15 @@ loadAllModules files = do
44createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
44createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
45createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =
45createTemporaryModule exec PSCiState{psciImportedModules = imports, psciLetBindings = lets} val =
46 let
46 let
47− moduleName = P.ModuleName [P.ProperName "$PSCI"]
47+ moduleName = P.ModuleName [P.ProperName "$PSCI"]
48− trace = P.Var (P.Qualified (Just supportModuleName) (P.Ident "eval"))
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"))
49− mainValue = P.App trace (P.Var (P.Qualified Nothing (P.Ident "it")))
50+ mainValue = P.App eval (P.Var (P.Qualified Nothing (P.Ident "it")))
50− itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
51+ itDecl = P.ValueDeclaration (P.Ident "it") P.Public [] $ Right val
51− mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
52+ mainDecl = P.ValueDeclaration (P.Ident "$main") P.Public [] $ Right mainValue
52− decls = if exec then [itDecl, mainDecl] else [itDecl]
53+ decls = if exec then [itDecl, mainDecl] else [itDecl]
53 in
54 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
55
56
56
57
57-- |
58-- |