summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-13 23:37:21 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-13 23:37:21 +0200
commit3a36441b617b9dff632eda0ac14ca26072e0730b (patch)
tree5764066d50c283ae5e1f91961732a1f657b06145
parent247257ed3e19fe4100c75bd9c8755e0c6db290af (diff)
Use foldrWithKey instead of deprecated foldWithKey.
-rw-r--r--pandoc.cabal4
-rw-r--r--src/Text/Pandoc/MediaBag.hs2
-rw-r--r--src/Text/Pandoc/Writers/Shared.hs2
3 files changed, 4 insertions, 4 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index dd92690ce..2734dcb02 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -283,7 +283,7 @@ Flag old-locale
Library
Build-Depends: base >= 4.7 && < 5,
syb >= 0.1 && < 0.8,
- containers >= 0.1 && < 0.6,
+ containers >= 0.4.2.1 && < 0.6,
unordered-containers >= 0.2 && < 0.3,
parsec >= 3.1 && < 3.2,
mtl >= 2.2 && < 2.3,
@@ -546,7 +546,7 @@ Test-Suite test-pandoc
tasty-quickcheck >= 0.8 && < 0.9,
tasty-golden >= 2.3 && < 2.4,
QuickCheck >= 2.4 && < 2.11,
- containers >= 0.1 && < 0.6,
+ containers >= 0.4.2.1 && < 0.6,
executable-path >= 0.0 && < 0.1,
zip-archive >= 0.2.3.4 && < 0.4,
mtl >= 2.2 && < 2.3
diff --git a/src/Text/Pandoc/MediaBag.hs b/src/Text/Pandoc/MediaBag.hs
index d8d6da345..f89c60c9e 100644
--- a/src/Text/Pandoc/MediaBag.hs
+++ b/src/Text/Pandoc/MediaBag.hs
@@ -79,5 +79,5 @@ lookupMedia fp (MediaBag mediamap) = M.lookup (splitDirectories fp) mediamap
-- their corresponding mime types and the lengths in bytes of the contents.
mediaDirectory :: MediaBag -> [(String, MimeType, Int)]
mediaDirectory (MediaBag mediamap) =
- M.foldWithKey (\fp (mime,contents) ->
+ M.foldrWithKey (\fp (mime,contents) ->
(((Posix.joinPath fp), mime, fromIntegral $ BL.length contents):)) [] mediamap
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
index 2047285eb..3f612f40a 100644
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -84,7 +84,7 @@ metaToJSON' blockWriter inlineWriter (Meta metamap) = do
renderedMap <- Traversable.mapM
(metaValueToJSON blockWriter inlineWriter)
metamap
- return $ M.foldWithKey defField (Object H.empty) renderedMap
+ return $ M.foldrWithKey defField (Object H.empty) renderedMap
-- | Add variables to JSON object, replacing any existing values.
-- Also include @meta-json@, a field containing a string representation