diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2015-01-30 12:31:12 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2015-02-18 12:50:21 +0000 |
commit | 9d772068278da6004712dd6b012d78f1b283a543 (patch) | |
tree | c156f73d89f2e8915511944a77c183779a3a8ba7 /src/Text/Pandoc/Parsing.hs | |
parent | e8677bae786190b203b84b7d42c30b0284bbb95c (diff) |
Changed parseWithWarnings to the more general returnWarnings parser transformer
Diffstat (limited to 'src/Text/Pandoc/Parsing.hs')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index ec15adf77..2a1d61b97 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -65,7 +65,7 @@ module Text.Pandoc.Parsing ( anyLine, widthsFromIndices, gridTableWith, readWith, - readWithWarnings, + returnWarnings, readWithM, testStringWith, guardEnabled, @@ -885,11 +885,10 @@ readWith :: Parser [Char] st a -> a readWith p t inp = runIdentity $ readWithM p t inp -readWithWarnings :: Parser [Char] ParserState a - -> ParserState - -> String - -> (a, [String]) -readWithWarnings p = readWith $ do +returnWarnings :: (Stream s m c) + => ParserT s ParserState m a + -> ParserT s ParserState m (a, [String]) +returnWarnings p = do doc <- p warnings <- stateWarnings <$> getState return (doc, warnings) |