From 073895c340b85dc66b45e0c716d8357f8c7c5a13 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 17:53:39 -0700 Subject: Fix some lint issues. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 7 +++---- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index bd7979ef3..c5704c8ad 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -79,10 +79,9 @@ letmacro = do checkGlobal :: PandocMonad m => LP m [(Text, Macro)] -> LP m [(Text, Macro)] checkGlobal p = - (do controlSeq "global" - ms <- p - return $ map (\(n, Macro _ expand arg optarg contents) -> - (n, Macro GlobalScope expand arg optarg contents)) ms) + (controlSeq "global" *> + (map (\(n, Macro _ expand arg optarg contents) -> + (n, Macro GlobalScope expand arg optarg contents)) <$> p)) <|> p edefmacro :: PandocMonad m => LP m [(Text, Macro)] diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index e1b72926f..075e1f656 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -224,8 +224,8 @@ instance HasIncludeFiles LaTeXState where instance HasMacros LaTeXState where extractMacros st = NonEmpty.head $ sMacros st - updateMacros f st = st{ sMacros = f (NonEmpty.head $ sMacros st) - :| (NonEmpty.tail $ sMacros st) } + updateMacros f st = st{ sMacros = f (NonEmpty.head (sMacros st)) + :| NonEmpty.tail (sMacros st) } instance HasReaderOptions LaTeXState where extractReaderOptions = sOptions -- cgit v1.2.3