Use <$> instead of >>= and return (#6128)
commit12c75701be4b87fc438be68af5658d71e5578f62
authorJoseph C. Sible <josephcsible@users.noreply.github.com>
dateSat 8 Feb 2020, 12:12 (7 years ago)
parente97a996
src/Text/Pandoc/Readers/Docx/Fields.hs+1−1
@@ -42,7 +42,7 @@ escapedQuote = string "\\\"" $> "\\\""
4242
4343inQuotes :: Parser T.Text
4444inQuotes =
45− try escapedQuote <|> (anyChar >>= (\c -> return $ T.singleton c))
45+ try escapedQuote <|> (T.singleton <$> anyChar)
4646
4747quotedString :: Parser T.Text
4848quotedString = do
test/Tests/Readers/Docx.hs+1−1
@@ -92,7 +92,7 @@ testForWarningsWithOpts opts name docxFile expected =
9292getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
9393getMedia archivePath mediaPath = do
9494 zf <- toArchive <$> B.readFile archivePath
95− return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry)
95+ return $ fromEntry <$> findEntryByPath ("word/" ++ mediaPath) zf
9696
9797compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
9898compareMediaPathIO mediaPath mediaBag docxPath = do