git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #530 and #531
commit8bd3795a385e58f85750a140425507c06bb40b57 authorBenjamin Kovach] <bkovach5@uga.edu> dateTue 5 Aug 2014, 13:49 (12 years ago) parent376fdeb
1 file changed+9−9
psci/Main.hs+9−9
psci/Main.hs+9−9
@@ -66,7 +66,7 @@ data PSCiState = PSCiState
6666 { psciImportedFilenames :: [FilePath]
6767 , psciImportedModuleNames :: [P.ModuleName]
6868 , psciLoadedModules :: [(FilePath, P.Module)]
69− , psciLetBindings :: [P.Value -> P.Value]
69+ , psciLetBindings :: [P.Expr -> P.Expr]
7070 }
7171
7272-- State helpers
@@ -92,7 +92,7 @@ updateModules modules st = st { psciLoadedModules = psciLoadedModules st ++ modu
9292-- |
9393-- Updates the state to have more let bindings.
9494--
95−updateLets :: (P.Value -> P.Value) -> PSCiState -> PSCiState
95+updateLets :: (P.Expr -> P.Expr) -> PSCiState -> PSCiState
9696updateLets name st = st { psciLetBindings = name : psciLetBindings st }
9797
9898-- File helpers
@@ -234,7 +234,7 @@ instance P.MonadMake Make where
234234 mkdirp path
235235 U.writeFile path text
236236 liftError = either throwError return
237− progress s = unless (s == "Compiling Main") $ makeIO . U.putStrLn $ s
237+ progress s = unless (s == "Compiling $PSCI") $ makeIO . U.putStrLn $ s
238238
239239mkdirp :: FilePath -> IO ()
240240mkdirp = createDirectoryIfMissing True . takeDirectory
@@ -242,11 +242,11 @@ mkdirp = createDirectoryIfMissing True . takeDirectory
242242-- |
243243-- Makes a volatile module to execute the current expression.
244244--
245−createTemporaryModule :: Bool -> PSCiState -> P.Value -> P.Module
245+createTemporaryModule :: Bool -> PSCiState -> P.Expr -> P.Module
246246createTemporaryModule exec PSCiState{psciImportedModuleNames = imports, psciLetBindings = lets} value =
247247 let
248248 moduleName = P.ModuleName [P.ProperName "$PSCI"]
249− importDecl m = P.ImportDeclaration m Nothing Nothing
249+ importDecl m = P.ImportDeclaration m P.Unqualified Nothing
250250 traceModule = P.ModuleName [P.ProperName "Debug", P.ProperName "Trace"]
251251 trace = P.Var (P.Qualified (Just traceModule) (P.Ident "print"))
252252 itValue = foldl (\x f -> f x) value lets
@@ -264,7 +264,7 @@ createTemporaryModuleForKind :: PSCiState -> P.Type -> P.Module
264264createTemporaryModuleForKind PSCiState{psciImportedModuleNames = imports} typ =
265265 let
266266 moduleName = P.ModuleName [P.ProperName "$PSCI"]
267− importDecl m = P.ImportDeclaration m Nothing Nothing
267+ importDecl m = P.ImportDeclaration m P.Unqualified Nothing
268268 itDecl = P.TypeSynonymDeclaration (P.ProperName "IT") [] typ
269269 in
270270 P.Module moduleName ((importDecl `map` imports) ++ [itDecl]) Nothing
@@ -278,7 +278,7 @@ indexFile = ".psci_modules" ++ pathSeparator : "index.js"
278278-- |
279279-- Takes a value declaration and evaluates it with the current state.
280280--
281−handleDeclaration :: P.Value -> PSCI ()
281+handleDeclaration :: P.Expr -> PSCI ()
282282handleDeclaration value = do
283283 st <- PSCI $ lift get
284284 let m = createTemporaryModule True st value
@@ -297,7 +297,7 @@ handleDeclaration value = do
297297-- |
298298-- Takes a value and prints its type
299299--
300−handleTypeOf :: P.Value -> PSCI ()
300+handleTypeOf :: P.Expr -> PSCI ()
301301handleTypeOf value = do
302302 st <- PSCI $ lift get
303303 let m = createTemporaryModule False st value
@@ -325,7 +325,7 @@ handleKindOf typ = do
325325 Just (_, typ') -> do
326326 let chk = P.CheckState env' 0 0 (Just mName)
327327 k = L.runStateT (P.unCheck (P.kindOf mName typ')) chk
328− case k of
328+ case k of
329329 Left errStack -> PSCI . outputStrLn . P.prettyPrintErrorStack False $ errStack
330330 Right (kind, _) -> PSCI . outputStrLn . P.prettyPrintKind $ kind
331331 Nothing -> PSCI $ outputStrLn "Could not find kind"