@@ -305,14 +305,27 @@ handleDeclaration value = do
305305 Just (ExitFailure _, _, err) -> PSCI $ outputStrLn err
306306 Nothing -> PSCI $ outputStrLn "Couldn't find node.js"
307307
308−handleShowModules :: PSCI ()
309−handleShowModules = do
308+-- |
309+-- Show actual loaded modules in psci.
310+--
311+handleShowLoadedModules :: PSCI ()
312+handleShowLoadedModules = do
310313 PSCiState { psciLoadedModules = loadedModules } <- PSCI $ lift get
311314 psciIO $ readModules loadedModules >>= putStrLn
312315 return ()
313316 where readModules = return . unlines . nub . map toModuleName
314317 toModuleName = N.runModuleName . (\ (D.Module mdName _ _) -> mdName) . snd
315318
319+-- |
320+-- Show the imported modules in psci.
321+--
322+handleShowImportedModules :: PSCI ()
323+handleShowImportedModules = do
324+ PSCiState { psciImportedModuleNames = importedModuleNames } <- PSCI $ lift get
325+ psciIO $ readModules importedModuleNames >>= putStrLn
326+ return ()
327+ where readModules = return . unlines . map N.runModuleName
328+
316329-- |
317330-- Imports a module, preserving the initial state on failure.
318331--
@@ -455,7 +468,8 @@ handleCommand Reset = do
455468handleCommand (TypeOf val) = handleTypeOf val
456469handleCommand (KindOf typ) = handleKindOf typ
457470handleCommand (Browse moduleName) = handleBrowse moduleName
458−handleCommand Show = handleShowModules
471+handleCommand (Show "loaded") = handleShowLoadedModules
472+handleCommand (Show "import") = handleShowImportedModules
459473handleCommand _ = PSCI $ outputStrLn "Unknown command"
460474
461475singleLineFlag :: Cmd.Term Bool