Factor out a return

pull/1/head
Gurkenglas 2016-08-06 23:31:27 +02:00 committed by GitHub
parent 422ad9f5ac
commit bcdfea8654
1 changed files with 4 additions and 4 deletions

View File

@ -107,11 +107,11 @@ parsePrintModule
parsePrintModule conf filename input = do parsePrintModule conf filename input = do
let inputStr = Text.unpack input let inputStr = Text.unpack input
parseResult <- ExactPrint.Parsers.parseModuleFromString filename inputStr parseResult <- ExactPrint.Parsers.parseModuleFromString filename inputStr
case parseResult of return $ case parseResult of
Left (_, s) -> return $ Left $ "parsing error: " ++ s Left (_, s) -> Left $ "parsing error: " ++ s
Right (anns, parsedModule) -> Right (anns, parsedModule) ->
let (errs, ltext) = pPrintModule conf anns parsedModule let (errs, ltext) = pPrintModule conf anns parsedModule
in return $ if null errs in if null errs
then Right $ TextL.toStrict $ ltext then Right $ TextL.toStrict $ ltext
else else
let errStrs = errs <&> \case let errStrs = errs <&> \case