From 377efd0ce7736685c2a43842743a11ae01ed0a0b Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 30 Mar 2020 00:11:05 -0400 Subject: Clean up some fmaps (#6226) * Avoid fmapping when we're just binding right after anyway * Clean up unnecessary fmaps in the LaTeX reader --- src/Text/Pandoc/Writers/Docx.hs | 6 +++--- src/Text/Pandoc/Writers/Markdown.hs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index a3c44a8a1..bfaf12bc0 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -236,11 +236,11 @@ writeDocx opts doc@(Pandoc meta _) = do -- Gets the template size let mbpgsz = mbsectpr >>= filterElementName (wname (=="pgSz")) - let mbAttrSzWidth = (elAttribs <$> mbpgsz) >>= lookupAttrTextBy ((=="w") . qName) + let mbAttrSzWidth = mbpgsz >>= lookupAttrTextBy ((=="w") . qName) . elAttribs let mbpgmar = mbsectpr >>= filterElementName (wname (=="pgMar")) - let mbAttrMarLeft = (elAttribs <$> mbpgmar) >>= lookupAttrTextBy ((=="left") . qName) - let mbAttrMarRight = (elAttribs <$> mbpgmar) >>= lookupAttrTextBy ((=="right") . qName) + let mbAttrMarLeft = mbpgmar >>= lookupAttrTextBy ((=="left") . qName) . elAttribs + let mbAttrMarRight = mbpgmar >>= lookupAttrTextBy ((=="right") . qName) . elAttribs -- Get the available area (converting the size and the margins to int and -- doing the difference diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 304147bee..5c264aa30 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -360,9 +360,9 @@ beginsWithOrderedListMarker str = notesAndRefs :: PandocMonad m => WriterOptions -> MD m (Doc Text) notesAndRefs opts = do - notes' <- reverse <$> gets stNotes >>= notesToMarkdown opts + notes' <- gets stNotes >>= notesToMarkdown opts . reverse modify $ \s -> s { stNotes = [] } - refs' <- reverse <$> gets stRefs >>= refsToMarkdown opts + refs' <- gets stRefs >>= refsToMarkdown opts . reverse modify $ \s -> s { stPrevRefs = stPrevRefs s ++ stRefs s , stRefs = []} -- cgit v1.2.3