packages feed

aeson-compat 0.3.8 → 0.3.9

raw patch · 3 files changed

+38/−14 lines, 3 filesdep +voiddep ~QuickCheckdep ~aesondep ~attoparsecPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: void

Dependency ranges changed: QuickCheck, aeson, attoparsec, base, base-compat, bytestring, containers, hashable, nats, semigroups, tasty, time

API changes (from Hackage documentation)

- Data.Aeson.Compat: class GToEncoding (f :: * -> *)
- Data.Aeson.Compat: class GToJSON (f :: * -> *)
- Data.Aeson.Compat: data Encoding :: *
+ Data.Aeson.Compat: parseJSONList :: FromJSON a => Value -> Parser [a]
+ Data.Aeson.Compat: toEncodingList :: ToJSON a => [a] -> Encoding
+ Data.Aeson.Compat: toJSONList :: ToJSON a => [a] -> Value
+ Data.Aeson.Compat: type Encoding = Encoding' Value
+ Data.Aeson.Compat: type GToEncoding = GToJSON Encoding
+ Data.Aeson.Compat: type GToJSON = GToJSON Value
- Data.Aeson.Compat: class GFromJSON (f :: * -> *)
+ Data.Aeson.Compat: class GFromJSON arity (f :: * -> *)
- Data.Aeson.Compat: data Parser a :: * -> *
+ Data.Aeson.Compat: data Parser a
- Data.Aeson.Compat: data Result a :: * -> *
+ Data.Aeson.Compat: data Result a
- Data.Aeson.Compat: data Series :: *
+ Data.Aeson.Compat: data Series
- Data.Aeson.Compat: data Value :: *
+ Data.Aeson.Compat: data Value
- Data.Aeson.Compat: fromEncoding :: Encoding -> Builder
+ Data.Aeson.Compat: fromEncoding :: Encoding' tag -> Builder
- Data.Aeson.Compat: genericParseJSON :: (Generic a, GFromJSON Rep a) => Options -> Value -> Parser a
+ Data.Aeson.Compat: genericParseJSON :: (Generic a, GFromJSON Zero Rep a) => Options -> Value -> Parser a
- Data.Aeson.Compat: genericToEncoding :: (Generic a, GToEncoding Rep a) => Options -> a -> Encoding
+ Data.Aeson.Compat: genericToEncoding :: (Generic a, GToJSON Encoding Zero Rep a) => Options -> a -> Encoding
- Data.Aeson.Compat: genericToJSON :: (Generic a, GToJSON Rep a) => Options -> a -> Value
+ Data.Aeson.Compat: genericToJSON :: (Generic a, GToJSON Value Zero Rep a) => Options -> a -> Value
- Data.Aeson.Compat: newtype DotNetTime :: *
+ Data.Aeson.Compat: newtype DotNetTime
- Data.Aeson.Compat: withArray :: () => String -> (Array -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withArray :: () => String -> Array -> Parser a -> Value -> Parser a
- Data.Aeson.Compat: withBool :: () => String -> (Bool -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withBool :: () => String -> Bool -> Parser a -> Value -> Parser a
- Data.Aeson.Compat: withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withEmbeddedJSON :: () => String -> Value -> Parser a -> Value -> Parser a
- Data.Aeson.Compat: withObject :: () => String -> (Object -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withObject :: () => String -> Object -> Parser a -> Value -> Parser a
- Data.Aeson.Compat: withScientific :: () => String -> (Scientific -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withScientific :: () => String -> Scientific -> Parser a -> Value -> Parser a
- Data.Aeson.Compat: withText :: () => String -> (Text -> Parser a) -> Value -> Parser a
+ Data.Aeson.Compat: withText :: () => String -> Text -> Parser a -> Value -> Parser a

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.3.9++- Add `ToJSON/FromJSON Void`+ # 0.3.8  - Re-implement `withNumber`
aeson-compat.cabal view
@@ -1,5 +1,5 @@ name:           aeson-compat-version:        0.3.8+version:        0.3.9 synopsis:       Compatibility layer for aeson description:    Compatibility layer for @aeson@ category:       Web@@ -12,12 +12,13 @@ build-type:     Simple cabal-version:  >= 1.10 tested-with:-  GHC==7.6.3,-  GHC==7.8.4,-  GHC==7.10.3,-  GHC==8.0.2,-  GHC==8.2.2,-  GHC==8.4.3+  GHC ==7.6.3+   || ==7.8.4+   || ==7.10.3+   || ==8.0.2+   || ==8.2.2+   || ==8.4.3+   || ==8.6.1  extra-source-files:     CHANGELOG.md@@ -32,13 +33,13 @@       src   ghc-options: -Wall   build-depends:-      base                     >=4.6  && <4.12+      base                     >=4.6  && <4.13     , base-compat              >=0.6.0 && <0.11     , aeson                    >=0.7.0.6 && <1.5     , attoparsec               >=0.12 && <0.14     , attoparsec-iso8601       >=1.0.0.0 && <1.1     , bytestring               >=0.10 && <0.11-    , containers               >=0.5  && <0.6+    , containers               >=0.5  && <0.7     , exceptions               >=0.8  && <0.11     , hashable                 >=1.2  && <1.3     , scientific               >=0.3  && <0.4@@ -51,10 +52,11 @@    if !impl(ghc >= 8.0)     build-depends:-      semigroups               >=0.16.2.2  && <0.19+      semigroups               >=0.18.5 && <0.19   if !impl(ghc >= 7.10)     build-depends:-      nats                     >=1         && <1.2+      nats                     >=1.1.2  && <1.2,+      void                     >=0.7.2  && <0.8    exposed-modules:       Data.Aeson.Compat@@ -83,11 +85,11 @@     , vector     , tagged     , aeson-compat-    , base-orphans          >=0.4.5 && <0.8+    , base-orphans          >=0.4.5 && <0.9     , tasty                 >=0.10 && <1.2     , tasty-hunit           >=0.9  && <0.11     , tasty-quickcheck      >=0.8  && <0.11-    , QuickCheck            >=2.10 && <2.12+    , QuickCheck            >=2.10 && <2.13     , quickcheck-instances  >=0.3.16  && <0.4    if !impl(ghc >= 8.0)@@ -95,5 +97,5 @@       semigroups   if !impl(ghc >= 7.10)     build-depends:-      nats+      nats, void   default-language: Haskell2010
src/Data/Aeson/Compat.hs view
@@ -151,6 +151,10 @@ import qualified Data.Vector        as V #endif +#if !MIN_VERSION_aeson(1,4,1)+import Data.Void (Void, absurd)+#endif+ import Data.Attoparsec.Number (Number (..))  -- | Exception thrown by 'decode' - family of functions in this module.@@ -430,6 +434,20 @@         ne (x:xs) = pure (x :| xs) #endif +#if !MIN_VERSION_aeson(1,4,1)+instance ToJSON Void where+    toJSON = absurd+    {-# INLINE toJSON #-}++#if MIN_VERSION_aeson(0,10,0)+    toEncoding = absurd+    {-# INLINE toEncoding #-}+#endif++instance FromJSON Void where+    parseJSON _ = fail "Cannot parse Void"+    {-# INLINE parseJSON #-}+#endif ------------------------------------------------------------------------------- -- with* -------------------------------------------------------------------------------