Use foldrWithKey instead of deprecated foldWithKey.

This commit is contained in:
John MacFarlane 2017-07-13 23:37:21 +02:00
parent 247257ed3e
commit 3a36441b61
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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