packages feed

aeson-value-parser 0.11 → 0.11.1

raw patch · 2 files changed

+14/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Aeson.ValueParser: foldrElements :: (b -> a -> a) -> a -> Value b -> Array a

Files

aeson-value-parser.cabal view
@@ -1,7 +1,7 @@ name:   aeson-value-parser version:-  0.11+  0.11.1 synopsis:   An API for parsing "aeson" JSON tree into Haskell types description:@@ -52,6 +52,6 @@     scientific == 0.3.*,     text == 1.*,     ---    success == 0.2.*,+    success >= 0.2 && < 0.3,     mtl-prelude < 3,     base-prelude >= 0.1.19 && < 0.2
library/Aeson/ValueParser.hs view
@@ -23,6 +23,7 @@   elementsVector,   foldlElements,   foldlElements1,+  foldrElements, ) where @@ -175,10 +176,18 @@ {-# INLINE foldlElements #-} foldlElements :: (a -> b -> a) -> a -> Value b -> Array a foldlElements step init (Value impl) =-  Array $ ReaderT $ foldl' step' (pure init)+  Array $ ReaderT $ foldlM step' init   where-    step' acc' element =-      acc' >>= \acc -> fmap (step acc) (runReaderT impl element)+    step' acc element =+      fmap (step acc) (runReaderT impl element)++{-# INLINE foldrElements #-}+foldrElements :: (b -> a -> a) -> a -> Value b -> Array a+foldrElements step init (Value impl) =+  Array $ ReaderT $ foldrM step' init+  where+    step' element acc =+      fmap (flip step acc) (runReaderT impl element)  {-# INLINE foldlElements1 #-} foldlElements1 :: (a -> a -> a) -> Value a -> Array a