@@ -56,6 +56,7 @@ import qualified System.IO.UTF8 as U
56 (writeFile, putStrLn, print, readFile)
56 (writeFile, putStrLn, print, readFile)
57import qualified Language.PureScript.Names as N
57import qualified Language.PureScript.Names as N
58import qualified Language.PureScript.Declarations as D
58import qualified Language.PureScript.Declarations as D
59+import qualified Language.PureScript.Constants as C
61-- The PSCI state.
62-- The PSCI state.
@@ -132,7 +133,7 @@ loadModule filename = either (Left . show) Right . P.runIndentParser filename P.
133loadAllModules :: [FilePath] -> IO (Either ParseError [(Either P.RebuildPolicy FilePath, P.Module)])
134loadAllModules :: [FilePath] -> IO (Either ParseError [(Either P.RebuildPolicy FilePath, P.Module)])
134loadAllModules files = do
135loadAllModules files = do
135− filesAndContent <- forM files $ \filename -> do
136+ filesAndContent <- forM files $ \filename -> do
136 content <- U.readFile filename
137 content <- U.readFile filename
137 return (Right filename, content)
138 return (Right filename, content)
138 return $ P.parseModulesFromFiles (either (const "") id) $ (Left P.RebuildNever, P.prelude) : filesAndContent
139 return $ P.parseModulesFromFiles (either (const "") id) $ (Left P.RebuildNever, P.prelude) : filesAndContent
@@ -444,7 +445,9 @@ handleCommand :: Command -> PSCI ()
444handleCommand (Expression val) = handleDeclaration val
445handleCommand (Expression val) = handleDeclaration val
445handleCommand Help = PSCI $ outputStrLn helpMessage
446handleCommand Help = PSCI $ outputStrLn helpMessage
446handleCommand (Import moduleName) = handleImport moduleName
447handleCommand (Import moduleName) = handleImport moduleName
448+handleCommand (Let l) = do
447−handleCommand (Let l) = PSCI $ lift $ modify (updateLets l)
449+ PSCI $ lift $ modify (updateLets l)
450+ handleDeclaration (D.Var (N.Qualified (Just $ N.ModuleName [N.ProperName C.prelude]) (N.Ident C.unit)))
448handleCommand (LoadFile filePath) = do
451handleCommand (LoadFile filePath) = do
449 absPath <- psciIO $ expandTilde filePath
452 absPath <- psciIO $ expandTilde filePath
450 exists <- psciIO $ doesFileExist absPath
453 exists <- psciIO $ doesFileExist absPath