diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-11-29 12:56:06 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-11-29 12:56:06 -0800 |
commit | 90f5dd88a4f9a5378e430438fc3ef8ab1c3db9a4 (patch) | |
tree | b7abc2f5efca2d60abe6ec30e4410eecf5a24f2a /src/Text/Pandoc/Writers.hs | |
parent | 5c9ddaac2c86242163b2f87f8d1cca6e1d1a49c8 (diff) | |
download | pandoc-90f5dd88a4f9a5378e430438fc3ef8ab1c3db9a4.tar.gz |
Changed types of writeJSON and readJSON.
Previously they were not monadic; we now have them run in an
instance of the Pandoc monad, like the other readers and writers.
[API change]
Diffstat (limited to 'src/Text/Pandoc/Writers.hs')
-rw-r--r-- | src/Text/Pandoc/Writers.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers.hs b/src/Text/Pandoc/Writers.hs index 5d4a9122a..b61404238 100644 --- a/src/Text/Pandoc/Writers.hs +++ b/src/Text/Pandoc/Writers.hs @@ -132,7 +132,7 @@ data Writer m = TextWriter (WriterOptions -> Pandoc -> m Text) writers :: PandocMonad m => [ ( String, Writer m) ] writers = [ ("native" , TextWriter writeNative) - ,("json" , TextWriter $ \o d -> return $ writeJSON o d) + ,("json" , TextWriter $ \o d -> writeJSON o d) ,("docx" , ByteStringWriter writeDocx) ,("odt" , ByteStringWriter writeODT) ,("pptx" , ByteStringWriter writePowerpoint) @@ -193,5 +193,5 @@ getWriter s Just r -> Right (r, setExts $ getDefaultExtensions writerName) -writeJSON :: WriterOptions -> Pandoc -> Text -writeJSON _ = UTF8.toText . BL.toStrict . encode +writeJSON :: PandocMonad m => WriterOptions -> Pandoc -> m Text +writeJSON _ = return . UTF8.toText . BL.toStrict . encode |