@@ -305,6 +305,14 @@ 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
310+ PSCiState { psciLoadedModules = loadedModules } <- PSCI $ lift get
311+ psciIO $ readModules loadedModules >>= putStrLn
312+ return ()
313+ where readModules = return . unlines . nub . map toModuleName
314+ toModuleName = N.runModuleName . (\ (D.Module mdName _ _) -> mdName) . snd
315+
308316-- |
309317-- Imports a module, preserving the initial state on failure.
310318--
@@ -447,6 +455,7 @@ handleCommand Reset = do
447455handleCommand (TypeOf val) = handleTypeOf val
448456handleCommand (KindOf typ) = handleKindOf typ
449457handleCommand (Browse moduleName) = handleBrowse moduleName
458+handleCommand Show = handleShowModules
450459handleCommand _ = PSCI $ outputStrLn "Unknown command"
451460
452461singleLineFlag :: Cmd.Term Bool