pandoc-types 1.12 → 1.12.1
raw patch · 2 files changed
+13/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Text.Pandoc.JSON: instance Data a => ToJSONFilter (a -> IO [a])
+ Text.Pandoc.JSON: instance Data a => ToJSONFilter (a -> [a])
Files
- Text/Pandoc/JSON.hs +12/−0
- pandoc-types.cabal +1/−1
Text/Pandoc/JSON.hs view
@@ -59,6 +59,7 @@ where import Text.Pandoc.Definition import Text.Pandoc.Walk+import Text.Pandoc.Generic import Data.Maybe (listToMaybe) import Data.Data import Data.ByteString.Lazy (ByteString)@@ -96,6 +97,17 @@ instance (Walkable a Pandoc) => ToJSONFilter (a -> IO a) where toJSONFilter f = BL.getContents >>= (walkM f :: Pandoc -> IO Pandoc) . either error id . eitherDecode' >>=+ BL.putStr . encode++instance Data a => ToJSONFilter (a -> [a]) where+ toJSONFilter f = BL.getContents >>=+ BL.putStr . encode . (bottomUp (concatMap f) :: Pandoc -> Pandoc) .+ either error id . eitherDecode'++instance Data a => ToJSONFilter (a -> IO [a]) where+ toJSONFilter f = BL.getContents >>=+ (bottomUpM (fmap concat . mapM f) :: Pandoc -> IO Pandoc) .+ either error id . eitherDecode' >>= BL.putStr . encode instance (ToJSONFilter a) => ToJSONFilter ([String] -> a) where
pandoc-types.cabal view
@@ -1,5 +1,5 @@ Name: pandoc-types-Version: 1.12+Version: 1.12.1 Synopsis: Types for representing a structured document Description: @Text.Pandoc.Definition@ defines the 'Pandoc' data structure, which is used by pandoc to represent