Factor out a return #1

Merged
Gurkenglas merged 1 commits from patch-1 into master 2016-08-06 23:37:15 +02:00
1 changed files with 4 additions and 4 deletions

View File

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