git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Refactor some more
9f9c336Antoine R. Dumont
psci/Main.hs+11−12
@@ -358,18 +358,17 @@ handleBrowse :: P.ModuleName -> PSCI ()
358handleBrowse moduleName = do
358handleBrowse moduleName = do
359 st <- PSCI $ lift get
359 st <- PSCI $ lift get
360 e <- psciIO . runMake $ P.make modulesDir options (psciLoadedModules st) []
360 e <- psciIO . runMake $ P.make modulesDir options (psciLoadedModules st) []
361− case e of
361+ PSCI $ case e of
362− Left err -> PSCI $ outputStrLn err
362+ Left err -> outputStrLn err
363− Right env' ->
363+ Right env' ->
364− let namesEnv = P.names env'
364+ let namesEnv = P.names env'
365− moduleNamesIdent = (filter ((== moduleName) . fst) . M.keys) namesEnv
365+ moduleNamesIdent = (filter ((== moduleName) . fst) . M.keys) namesEnv
366− in case moduleNamesIdent of
366+ in case moduleNamesIdent of
367− [] -> (PSCI . outputStrLn) "A correct module name must be specified. See `:s loaded` command for a list of those."
367+ [] -> outputStrLn "A correct module name must be specified. See `:s loaded` command for a list of those."
368− _ -> ( PSCI
369− . outputStrLn
368+ _ -> ( outputStrLn
370− . unlines
369+ . unlines
371− . sort
370+ . sort
372− . map (showType . findType namesEnv)) moduleNamesIdent
371+ . map (showType . findType namesEnv)) moduleNamesIdent
373 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))
372 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))
374 findType envNames m@(_, mIdent) = (mIdent, M.lookup m envNames)
373 findType envNames m@(_, mIdent) = (mIdent, M.lookup m envNames)
375 showType :: (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility)) -> String
374 showType :: (P.Ident, Maybe (P.Type, P.NameKind, P.NameVisibility)) -> String