Skip to content

Commit

Permalink
Don't use do in cfgReadProject.
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Sep 5, 2022
1 parent b523207 commit 92d3141
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Stack/ConfigCmd.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,9 @@ cfgReadProject scope = do
(configFilePath, yamlConfig) <- cfgRead scope
let parser = parseProjectAndConfigMonoid (parent configFilePath)
case Yaml.parseEither parser yamlConfig of
Left err -> do
logError . display $ T.pack err
return Nothing
Right (WithJSONWarnings res _warnings) -> do
ProjectAndConfigMonoid project _ <- liftIO res
return $ Just project
Left err -> logError (display $ T.pack err) >> return Nothing
Right (WithJSONWarnings res _warnings) -> liftIO res >>=
\(ProjectAndConfigMonoid project _) -> return $ Just project

cfgCmdDumpProject :: (HasConfig env, HasLogFunc env) => ConfigCmdDumpProject -> RIO env ()
cfgCmdDumpProject (ConfigCmdDumpProject dumpFormat) = do
Expand Down

0 comments on commit 92d3141

Please sign in to comment.