From 92d314162e59f1d4c2b8da88443013d61866ad9e Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Mon, 5 Sep 2022 17:35:28 -0400 Subject: [PATCH] Don't use do in cfgReadProject. --- src/Stack/ConfigCmd.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Stack/ConfigCmd.hs b/src/Stack/ConfigCmd.hs index d0567d4eb4..bfd6e23eb1 100644 --- a/src/Stack/ConfigCmd.hs +++ b/src/Stack/ConfigCmd.hs @@ -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