diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-26 12:09:59 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-26 12:09:59 +0300 |
commit | 73463b823929ce4930ed60e576d13a148ffb573c (patch) | |
tree | 32d20214a2a8f9b6567282927f71cd532ca87b9f /src/Text/Pandoc | |
parent | 188f9f4c53179e474d9538927345583b8e91770e (diff) | |
download | pandoc-73463b823929ce4930ed60e576d13a148ffb573c.tar.gz |
Muse reader: use Data.Map.member instead of lookup
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 43c835edb..f21a169fd 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -50,7 +50,7 @@ import Data.List (stripPrefix, intercalate) import Data.List.Split (splitOn) import qualified Data.Map as M import qualified Data.Set as Set -import Data.Maybe (fromMaybe, isJust, isNothing) +import Data.Maybe (fromMaybe, isNothing) import Data.Text (Text, unpack) import System.FilePath (takeExtension) import Text.HTML.TagSoup @@ -515,7 +515,7 @@ amuseNoteBlockUntil end = try $ do updateState (\st -> st { museInPara = False }) (content, e) <- listItemContentsUntil (sourceColumn pos - 1) (fail "x") end oldnotes <- museNotes <$> getState - when (isJust (M.lookup ref oldnotes)) + when (M.member ref oldnotes) (logMessage $ DuplicateNoteReference ref pos) updateState $ \s -> s{ museNotes = M.insert ref (pos, content) oldnotes } return (mempty, e) @@ -529,7 +529,7 @@ emacsNoteBlock = try $ do ref <- noteMarker <* skipSpaces content <- mconcat <$> blocksTillNote oldnotes <- museNotes <$> getState - when (isJust (M.lookup ref oldnotes)) + when (M.member ref oldnotes) (logMessage $ DuplicateNoteReference ref pos) updateState $ \s -> s{ museNotes = M.insert ref (pos, content) oldnotes } return mempty |