Use <$> instead of >>= and return (#6128)

This commit is contained in:
Joseph C. Sible 2020-02-08 12:12:01 -05:00 committed by GitHub
parent e97a99616e
commit 12c75701be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ escapedQuote = string "\\\"" $> "\\\""
inQuotes :: Parser T.Text
inQuotes =
try escapedQuote <|> (anyChar >>= (\c -> return $ T.singleton c))
try escapedQuote <|> (T.singleton <$> anyChar)
quotedString :: Parser T.Text
quotedString = do

View file

@ -92,7 +92,7 @@ testForWarningsWithOpts opts name docxFile expected =
getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
getMedia archivePath mediaPath = do
zf <- toArchive <$> B.readFile archivePath
return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry)
return $ fromEntry <$> findEntryByPath ("word/" ++ mediaPath) zf
compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
compareMediaPathIO mediaPath mediaBag docxPath = do