@@ -305,6 +305,14 @@ handleDeclaration value = do
305 Just (ExitFailure _, _, err) -> PSCI $ outputStrLn err
305 Just (ExitFailure _, _, err) -> PSCI $ outputStrLn err
306 Nothing -> PSCI $ outputStrLn "Couldn't find node.js"
306 Nothing -> PSCI $ outputStrLn "Couldn't find node.js"
308+handleShowModules :: PSCI ()
309+handleShowModules = do
310+ PSCiState { psciLoadedModules = loadedModules } <- PSCI $ lift get
311+ psciIO $ readModules loadedModules >>= putStrLn
313+ where readModules = return . unlines . nub . map toModuleName
314+ toModuleName = N.runModuleName . (\ (D.Module mdName _ _) -> mdName) . snd
309-- Imports a module, preserving the initial state on failure.
317-- Imports a module, preserving the initial state on failure.
@@ -447,6 +455,7 @@ handleCommand Reset = do
447handleCommand (TypeOf val) = handleTypeOf val
455handleCommand (TypeOf val) = handleTypeOf val
448handleCommand (KindOf typ) = handleKindOf typ
456handleCommand (KindOf typ) = handleKindOf typ
449handleCommand (Browse moduleName) = handleBrowse moduleName
457handleCommand (Browse moduleName) = handleBrowse moduleName
458+handleCommand Show = handleShowModules
450handleCommand _ = PSCI $ outputStrLn "Unknown command"
459handleCommand _ = PSCI $ outputStrLn "Unknown command"
452singleLineFlag :: Cmd.Term Bool
461singleLineFlag :: Cmd.Term Bool