@@ -360,15 +360,17 @@ handleBrowse moduleName = do
360360 st <- PSCI $ lift get
361361 e <- psciIO . runMake $ P.make modulesDir options (psciLoadedModules st) []
362362 case e of
363− Left err -> PSCI $ outputStrLn err
363+ Left err -> PSCI $ outputStrLn err
364364 Right env' ->
365365 let namesEnv = P.names env'
366366 moduleNamesIdent = (filter ((== moduleName) . fst) . M.keys) namesEnv
367− in (PSCI
368− . outputStrLn
369− . unlines
370− . sort
371− . map (showType . findType namesEnv)) moduleNamesIdent
367+ in case moduleNamesIdent of
368+ [] -> (PSCI . outputStrLn) "A correct module name must be specified. See `:s loaded` command for a list of those."
369+ _ -> ( PSCI
370+ . outputStrLn
371+ . unlines
372+ . sort
373+ . map (showType . findType namesEnv)) moduleNamesIdent
372374 where findType :: M.Map (P.ModuleName, P.Ident) (P.Type, P.NameKind, P.NameVisibility) -> (P.ModuleName, P.Ident) -> (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility))
373375 findType envNames m@(_, mIdent) = (mIdent, M.lookup m envNames)
374376 showType :: (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility)) -> String