git.iko.soy/typeable/pandoc
on master help sign in
Clean up overcomplicated maybe logic (#6105)

We're using maybe in redundant ways. Remove it altogether in one case and simplify it to fromMaybe in another.

commit6371ec241d63e0faf3a181aa4b08fb32ebb2eff1 authorJoseph C. Sible <josephcsible@users.noreply.github.com> dateMon 3 Feb 2020, 11:26 (7 years ago) parent8d6fac1
1 file changed+6−8
src/Text/Pandoc/PDF.hs+6−8
src/Text/Pandoc/PDF.hs+6−8
@@ -145,18 +145,16 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do
145145 let args = pdfargs ++ mathArgs ++ concatMap toArgs
146146 [("page-size", getField "papersize" meta')
147147 ,("title", getField "title" meta')
148− ,("margin-bottom", maybe (Just "1.2in") Just
148+ ,("margin-bottom", Just $ fromMaybe "1.2in"
149149 (getField "margin-bottom" meta'))
150− ,("margin-top", maybe (Just "1.25in") Just
150+ ,("margin-top", Just $ fromMaybe "1.25in"
151151 (getField "margin-top" meta'))
152− ,("margin-right", maybe (Just "1.25in") Just
152+ ,("margin-right", Just $ fromMaybe "1.25in"
153153 (getField "margin-right" meta'))
154− ,("margin-left", maybe (Just "1.25in") Just
154+ ,("margin-left", Just $ fromMaybe "1.25in"
155155 (getField "margin-left" meta'))
156− ,("footer-html", maybe Nothing Just
157− (getField "footer-html" meta'))
158− ,("header-html", maybe Nothing Just
159− (getField "header-html" meta'))
156+ ,("footer-html", getField "footer-html" meta')
157+ ,("header-html", getField "header-html" meta')
160158 ]
161159 source <- writer opts doc
162160 verbosity <- getVerbosity