Skip to content

Commit 92d3141

Browse files
committed
Don't use do in cfgReadProject.
1 parent b523207 commit 92d3141

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Stack/ConfigCmd.hs

+3-6
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,9 @@ cfgReadProject scope = do
159159
(configFilePath, yamlConfig) <- cfgRead scope
160160
let parser = parseProjectAndConfigMonoid (parent configFilePath)
161161
case Yaml.parseEither parser yamlConfig of
162-
Left err -> do
163-
logError . display $ T.pack err
164-
return Nothing
165-
Right (WithJSONWarnings res _warnings) -> do
166-
ProjectAndConfigMonoid project _ <- liftIO res
167-
return $ Just project
162+
Left err -> logError (display $ T.pack err) >> return Nothing
163+
Right (WithJSONWarnings res _warnings) -> liftIO res >>=
164+
\(ProjectAndConfigMonoid project _) -> return $ Just project
168165

169166
cfgCmdDumpProject :: (HasConfig env, HasLogFunc env) => ConfigCmdDumpProject -> RIO env ()
170167
cfgCmdDumpProject (ConfigCmdDumpProject dumpFormat) = do

0 commit comments

Comments
 (0)