aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-02-02 10:38:30 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2015-02-18 12:50:21 +0000
commit9cd0bdb41a2c14e0f28e5ab179b0da73a0b8ba78 (patch)
tree943d9fa9ba60b6a52bc91c061ff4ac7af0b67c8b /src/Text/Pandoc/Readers/Org.hs
parentfebe5112af6c917525b9fded66e00abc5245ab07 (diff)
downloadpandoc-9cd0bdb41a2c14e0f28e5ab179b0da73a0b8ba78.tar.gz
Factor out "returnState" into Parsing module
Diffstat (limited to 'src/Text/Pandoc/Readers/Org.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs
index 5cb66bfa7..fd58956d0 100644
--- a/src/Text/Pandoc/Readers/Org.hs
+++ b/src/Text/Pandoc/Readers/Org.hs
@@ -67,17 +67,11 @@ readOrg opts s = runOrg opts s parseOrg
runOrg :: ReaderOptions -> String -> OrgParser a -> a
runOrg opts inp p = fst res
where
- imd = readWithM (retState p) def{ orgStateOptions = opts } (inp ++ "\n\n")
+ imd = readWithM (returnState p) def{ orgStateOptions = opts } (inp ++ "\n\n")
res = runReader imd s
s :: OrgParserState
s = snd $ runReader imd s
-retState :: OrgParser a -> OrgParser (a, OrgParserState)
-retState p = do
- r <- p
- s <- getState
- return (r, s)
-
type OrgParser a = ParserT [Char] OrgParserState (Reader OrgParserState) a
parseOrg :: OrgParser Pandoc