packages feed

aeson 0.8.1.1 → 0.9.0.0

raw patch · 5 files changed

+40/−26 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Data/Aeson.hs view
@@ -94,10 +94,7 @@ -- returned. -- -- The input must consist solely of a JSON document, with no trailing--- data except for whitespace. This restriction is necessary to ensure--- that if data is being lazily read from a file handle, the file--- handle will be closed in a timely fashion once the document has--- been parsed.+-- data except for whitespace. -- -- This function parses immediately, but defers conversion.  See -- 'json' for details.
Data/Aeson/Encode/ByteString.hs view
@@ -13,6 +13,7 @@  module Data.Aeson.Encode.ByteString     ( encode+    , encodeToBuilder     , encodeToByteStringBuilder     ) where @@ -38,17 +39,22 @@  -- | Efficiently serialize a JSON value as a lazy 'L.ByteString'. encode :: ToJSON a => a -> L.ByteString-encode = B.toLazyByteString . encodeToByteStringBuilder . toJSON+encode = B.toLazyByteString . encodeToBuilder . toJSON  -- | Encode a JSON value to a ByteString 'B.Builder'. Use this function if you -- must prepend or append further bytes to the encoded JSON value.+encodeToBuilder :: Value -> Builder+encodeToBuilder Null       = null+encodeToBuilder (Bool b)   = bool b+encodeToBuilder (Number n) = number n+encodeToBuilder (String s) = string s+encodeToBuilder (Array v)  = array v+encodeToBuilder (Object m) = object m++-- | This function is an alias for 'encodeToBuilder'. encodeToByteStringBuilder :: Value -> Builder-encodeToByteStringBuilder Null       = null-encodeToByteStringBuilder (Bool b)   = bool b-encodeToByteStringBuilder (Number n) = number n-encodeToByteStringBuilder (String s) = string s-encodeToByteStringBuilder (Array v)  = array v-encodeToByteStringBuilder (Object m) = object m+encodeToByteStringBuilder = encodeToBuilder+{-# DEPRECATED encodeToByteStringBuilder "Use encodeToBuilder instead." #-}  null :: Builder null = BP.primBounded (ascii4 ('n',('u',('l','l')))) ()
Data/Aeson/Parser/Internal.hs view
@@ -72,32 +72,30 @@ #define C_n 110 #define C_t 116 --- | Parse a top-level JSON value.  This must be either an object or--- an array, per RFC 4627.+-- | Parse a top-level JSON value. -- -- The conversion of a parsed value to a Haskell value is deferred -- until the Haskell value is needed.  This may improve performance if -- only a subset of the results of conversions are needed, but at a -- cost in thunk allocation.+--+-- This function is an alias for 'value'. In aeson 0.8 and earlier, it+-- parsed only object or array types, in conformance with the+-- now-obsolete RFC 4627. json :: Parser Value-json = json_ object_ array_+json = value --- | Parse a top-level JSON value.  This must be either an object or--- an array, per RFC 4627.+-- | Parse a top-level JSON value. -- -- This is a strict version of 'json' which avoids building up thunks -- during parsing; it performs all conversions immediately.  Prefer -- this version if most of the JSON data needs to be accessed.+--+-- This function is an alias for 'value''. In aeson 0.8 and earlier, it+-- parsed only object or array types, in conformance with the+-- now-obsolete RFC 4627. json' :: Parser Value-json' = json_ object_' array_'--json_ :: Parser Value -> Parser Value -> Parser Value-json_ obj ary = do-  w <- skipSpace *> A.satisfy (\w -> w == OPEN_CURLY || w == OPEN_SQUARE)-  if w == OPEN_CURLY-    then obj-    else ary-{-# INLINE json_ #-}+json' = value'  object_ :: Parser Value object_ = {-# SCC "object_" #-} Object <$> objectValues jstring value
aeson.cabal view
@@ -1,5 +1,5 @@ name:            aeson-version:         0.8.1.1+version:         0.9.0.0 license:         BSD3 license-file:    LICENSE category:        Text, Web, JSON
changelog.md view
@@ -1,3 +1,16 @@+0.9.0.0++* The json and json' parsers are now synonyms for value and value', in+  conformance with the looser semantics of RFC 7159.++* Renamed encodeToByteStringBuilder to the more compact+  encodeToBuilder.++0.8.1.1++* The dependency on the unordered-containers package was too lax, and+  has been corrected.+ 0.8.1.0  * Encoding a Scientific value with a huge exponent is now handled