aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App
diff options
context:
space:
mode:
authorJoseph C. Sible <josephcsible@users.noreply.github.com>2020-02-07 02:10:09 -0500
committerGitHub <noreply@github.com>2020-02-06 23:10:09 -0800
commit013a1647a7c78e92b12c2ae520699ef7a567029a (patch)
tree5f5e91d37b1f166a0050540943867f5b51a952af /src/Text/Pandoc/App
parent30c8980883921e0672c36db2ad77ab31c147190c (diff)
downloadpandoc-013a1647a7c78e92b12c2ae520699ef7a567029a.tar.gz
Use traverse instead of reimplementing it (#6124)
Diffstat (limited to 'src/Text/Pandoc/App')
-rw-r--r--src/Text/Pandoc/App/OutputSettings.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs
index 3363acbb9..0dea81c38 100644
--- a/src/Text/Pandoc/App/OutputSettings.hs
+++ b/src/Text/Pandoc/App/OutputSettings.hs
@@ -65,9 +65,7 @@ optToOutputSettings opts = do
mapM_ (UTF8.hPutStrLn stdout) (fromMaybe [] $ optInputFiles opts)
exitSuccess
- epubMetadata <- case optEpubMetadata opts of
- Nothing -> return Nothing
- Just fp -> Just <$> readUtf8File fp
+ epubMetadata <- traverse readUtf8File $ optEpubMetadata opts
let pdfOutput = map toLower (takeExtension outputFile) == ".pdf" ||
optTo opts == Just "pdf"
@@ -112,8 +110,7 @@ optToOutputSettings opts = do
syntaxMap <- foldM addSyntaxMap defaultSyntaxMap
(optSyntaxDefinitions opts)
- hlStyle <- maybe (return Nothing) (fmap Just . lookupHighlightStyle . T.unpack)
- (optHighlightStyle opts)
+ hlStyle <- traverse (lookupHighlightStyle . T.unpack) $ optHighlightStyle opts
let setVariableM k v = return . setVariable k v