packages feed

json-bytes-builder 0.5.1 → 0.5.2

raw patch · 4 files changed

+24/−3 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ JSONBytesBuilder.Builder: arrayFromLiterals :: [Literal] -> Literal
+ JSONBytesBuilder.Builder: objectFromRows :: [Rows] -> Literal

Files

json-bytes-builder.cabal view
@@ -1,7 +1,7 @@ name:   json-bytes-builder version:-  0.5.1+  0.5.2 synopsis:   Direct-to-bytes JSON Builder description:
library/JSONBytesBuilder/Builder.hs view
@@ -15,7 +15,9 @@   stringFromBytes,   stringFromLazyBytes,   object,+  objectFromRows,   array,+  arrayFromLiterals,   -- ** Rows builders   Rows,   row,
library/JSONBytesBuilder/Private/Builder.hs view
@@ -115,11 +115,15 @@ stringFromLazyText =   Literal . inline E.stringFromLazyText +-- |+-- JSON String literal from 'ByteString' with only escaping applied to it. {-# INLINE stringFromBytes #-} stringFromBytes :: ByteString -> Literal stringFromBytes =   Literal . inline E.stringFromBytes +-- |+-- JSON String literal from lazy ByteString with only escaping applied to it. {-# INLINE stringFromLazyBytes #-} stringFromLazyBytes :: D.ByteString -> Literal stringFromLazyBytes =@@ -133,11 +137,26 @@   Literal (maybe E.emptyObject (inline E.inCurlies) x)  -- |+-- JSON Object literal from a list of rows.+-- A convienience shortcut to @object . mconcat@ for typical cases.+{-# INLINE objectFromRows #-}+objectFromRows :: [Rows] -> Literal+objectFromRows =+  object . mconcat++-- | -- JSON Array literal from the 'Elements' builder. {-# INLINE array #-} array :: Elements -> Literal array (Elements x) =   Literal (maybe E.emptyArray (inline E.inSquarelies) x)++-- |+-- JSON Array literal from a list of element literals.+-- A convienience shortcut to @array . foldMap element@ for typical cases.+arrayFromLiterals :: [Literal] -> Literal+arrayFromLiterals =+  array . foldMap element  -- | -- Rows builder from a key-value pair,
library/JSONBytesBuilder/Private/ByteString/Builder.hs view
@@ -37,12 +37,12 @@ {-# INLINABLE stringFromBytes #-} stringFromBytes :: ByteString -> Builder stringFromBytes x =-  char8 '"' <> A.primMapByteStringBounded (inline A.stringEncodedByte) x <> char8 '"'+  char8 '"' <> A.primMapByteStringBounded A.stringEncodedByte x <> char8 '"'  {-# INLINABLE stringFromLazyBytes #-} stringFromLazyBytes :: F.ByteString -> Builder stringFromLazyBytes x =-  char8 '"' <> A.primMapLazyByteStringBounded (inline A.stringEncodedByte) x <> char8 '"'+  char8 '"' <> A.primMapLazyByteStringBounded A.stringEncodedByte x <> char8 '"'  {-# INLINABLE scientific #-} scientific :: Scientific -> Builder