packages feed

lens-aeson 0.1.1.2 → 0.1.2

raw patch · 3 files changed

+14/−3 lines, 3 filesdep ~lens

Dependency ranges changed: lens

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.1.2+-----+* Added `members` and `values`+ 0.1.1 ----- * Broadened dependencies
lens-aeson.cabal view
@@ -1,6 +1,6 @@ name:          lens-aeson category:      Numeric-version:       0.1.1.2+version:       0.1.2 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE@@ -44,7 +44,7 @@ library   build-depends:     base                 >= 4.3       && < 5,-    lens                 >= 3.9       && < 3.10,+    lens                 >= 3.9       && < 3.11,     text                 >= 0.11.1.10 && < 0.12,     vector               >= 0.9       && < 0.11,     unordered-containers >= 0.2.3     && < 0.3,
src/Control/Lens/Aeson.hs view
@@ -29,7 +29,8 @@   , AsPrimitive(..)   -- * Objects and Arrays   , AsValue(..)-  , key, nth+  , key, members+  , nth, values   -- * Decoding   , AsJSON(..)   ) where@@ -255,6 +256,9 @@ key :: AsValue t => Text -> Traversal' t Value key i = _Object . ix i +members :: AsValue t => IndexedTraversal' Text t Value+members = _Object . each+ -- | Like 'ix', but for Arrays with Int indexes -- -- >>> "[1,2,3]" ^? nth 1@@ -267,6 +271,9 @@ -- "[1,20,3]" nth :: AsValue t => Int -> Traversal' t Value nth i = _Array . ix i++values :: AsValue t => IndexedTraversal' Int t Value+values = _Array . traversed  class AsJSON t where   -- | A Prism into 'Value' on lazy 'ByteString's.