packages feed

safe-json 1.2.1.0 → 1.2.1.1

raw patch · 3 files changed

+57/−11 lines, 3 filesdep ~timePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: time

API changes (from Hackage documentation)

+ Data.Aeson.Safe: ($dmfromJSONKey) :: (FromJSONKey a, FromJSON a) => FromJSONKeyFunction a
+ Data.Aeson.Safe: ($dmfromJSONKeyList) :: (FromJSONKey a, FromJSON a) => FromJSONKeyFunction [a]
+ Data.Aeson.Safe: ($dmliftParseJSON) :: (FromJSON1 f, Generic1 f, GFromJSON One (Rep1 f)) => Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (f a)
+ Data.Aeson.Safe: ($dmliftToEncoding) :: (ToJSON1 f, Generic1 f, GToJSON' Encoding One (Rep1 f)) => (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> f a -> Encoding
+ Data.Aeson.Safe: ($dmliftToJSON) :: (ToJSON1 f, Generic1 f, GToJSON' Value One (Rep1 f)) => (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> f a -> Value
+ Data.Aeson.Safe: ($dmtoJSONKey) :: (ToJSONKey a, ToJSON a) => ToJSONKeyFunction a
+ Data.Aeson.Safe: ($dmtoJSONKeyList) :: (ToJSONKey a, ToJSON a) => ToJSONKeyFunction [a]
+ Data.Aeson.Safe: (.!=) :: Parser (Maybe a) -> a -> Parser a
+ Data.Aeson.Safe: (.:!) :: FromJSON a => Object -> Key -> Parser (Maybe a)
+ Data.Aeson.Safe: (.:!=) :: FromJSON a => Object -> Key -> Parser a
+ Data.Aeson.Safe: (.:) :: FromJSON a => Object -> Key -> Parser a
+ Data.Aeson.Safe: (.:?) :: FromJSON a => Object -> Key -> Parser (Maybe a)
+ Data.Aeson.Safe: (.:?=) :: FromJSON a => Object -> Key -> Parser a
+ Data.Aeson.Safe: (.=) :: (KeyValue e kv, ToJSON v) => Key -> v -> kv
+ Data.Aeson.Safe: (.?=) :: (KeyValueOmit e kv, ToJSON v) => Key -> v -> kv
+ Data.Aeson.Safe: (<?>) :: Parser a -> JSONPathElement -> Parser a
+ Data.Aeson.Safe: AesonException :: String -> AesonException
+ Data.Aeson.Safe: Array :: !Array -> Value
+ Data.Aeson.Safe: Bool :: !Bool -> Value
+ Data.Aeson.Safe: DotNetTime :: UTCTime -> DotNetTime
+ Data.Aeson.Safe: Error :: String -> Result a
+ Data.Aeson.Safe: Null :: Value
+ Data.Aeson.Safe: Number :: !Scientific -> Value
+ Data.Aeson.Safe: Object :: !Object -> Value
+ Data.Aeson.Safe: ObjectWithSingleField :: SumEncoding
+ Data.Aeson.Safe: String :: !Text -> Value
+ Data.Aeson.Safe: Success :: a -> Result a
+ Data.Aeson.Safe: TaggedObject :: String -> String -> SumEncoding
+ Data.Aeson.Safe: ToJSONKeyText :: !a -> Key -> !a -> Encoding' Key -> ToJSONKeyFunction a
+ Data.Aeson.Safe: ToJSONKeyValue :: !a -> Value -> !a -> Encoding -> ToJSONKeyFunction a
+ Data.Aeson.Safe: TwoElemArray :: SumEncoding
+ Data.Aeson.Safe: UntaggedValue :: SumEncoding
+ Data.Aeson.Safe: [FromJSONKeyCoerce] :: forall a. Coercible Text a => FromJSONKeyFunction a
+ Data.Aeson.Safe: [FromJSONKeyTextParser] :: forall a. !Text -> Parser a -> FromJSONKeyFunction a
+ Data.Aeson.Safe: [FromJSONKeyText] :: forall a. !Text -> a -> FromJSONKeyFunction a
+ Data.Aeson.Safe: [FromJSONKeyValue] :: forall a. !Value -> Parser a -> FromJSONKeyFunction a
+ Data.Aeson.Safe: [contentsFieldName] :: SumEncoding -> String
+ Data.Aeson.Safe: [fromDotNetTime] :: DotNetTime -> UTCTime
+ Data.Aeson.Safe: [tagFieldName] :: SumEncoding -> String
+ Data.Aeson.Safe: camelTo2 :: Char -> String -> String
+ Data.Aeson.Safe: class FromJSON a
+ Data.Aeson.Safe: class FromJSON1 (f :: Type -> Type)
+ Data.Aeson.Safe: class FromJSON2 (f :: Type -> Type -> Type)
+ Data.Aeson.Safe: class FromJSONKey a
+ Data.Aeson.Safe: class GFromJSON arity (f :: Type -> Type)
+ Data.Aeson.Safe: class (ConstructorNames f, SumFromString f) => GFromJSONKey (f :: Type -> Type)
+ Data.Aeson.Safe: class GToJSON' enc arity (f :: Type -> Type)
+ Data.Aeson.Safe: class GetConName f => GToJSONKey (f :: k -> Type)
+ Data.Aeson.Safe: class KeyValue e kv | kv -> e
+ Data.Aeson.Safe: class KeyValue e kv => KeyValueOmit e kv | kv -> e
+ Data.Aeson.Safe: class ToJSON a
+ Data.Aeson.Safe: class ToJSON1 (f :: Type -> Type)
+ Data.Aeson.Safe: class ToJSON2 (f :: Type -> Type -> Type)
+ Data.Aeson.Safe: class ToJSONKey a
+ Data.Aeson.Safe: data FromArgs arity a
+ Data.Aeson.Safe: data FromJSONKeyFunction a
+ Data.Aeson.Safe: data JSONKeyOptions
+ Data.Aeson.Safe: data Key
+ Data.Aeson.Safe: data One
+ Data.Aeson.Safe: data Options
+ Data.Aeson.Safe: data Parser a
+ Data.Aeson.Safe: data Result a
+ Data.Aeson.Safe: data Series
+ Data.Aeson.Safe: data SumEncoding
+ Data.Aeson.Safe: data ToArgs res arity a
+ Data.Aeson.Safe: data ToJSONKeyFunction a
+ Data.Aeson.Safe: data Value
+ Data.Aeson.Safe: data Zero
+ Data.Aeson.Safe: decodeStrictText :: FromJSON a => Text -> Maybe a
+ Data.Aeson.Safe: defaultJSONKeyOptions :: JSONKeyOptions
+ Data.Aeson.Safe: defaultOptions :: Options
+ Data.Aeson.Safe: defaultTaggedObject :: SumEncoding
+ Data.Aeson.Safe: eitherDecodeStrictText :: FromJSON a => Text -> Either String a
+ Data.Aeson.Safe: explicitToField :: KeyValue e kv => (v -> e) -> Key -> v -> kv
+ Data.Aeson.Safe: explicitToFieldOmit :: KeyValueOmit e kv => (v -> Bool) -> (v -> e) -> Key -> v -> kv
+ Data.Aeson.Safe: foldable :: (Foldable t, ToJSON a) => t a -> Encoding
+ Data.Aeson.Safe: fromEncoding :: Encoding' tag -> Builder
+ Data.Aeson.Safe: fromJSON :: FromJSON a => Value -> Result a
+ Data.Aeson.Safe: fromJSONKey :: FromJSONKey a => FromJSONKeyFunction a
+ Data.Aeson.Safe: fromJSONKeyList :: FromJSONKey a => FromJSONKeyFunction [a]
+ Data.Aeson.Safe: genericFromJSONKey :: (Generic a, GFromJSONKey (Rep a)) => JSONKeyOptions -> FromJSONKeyFunction a
+ Data.Aeson.Safe: genericLiftParseJSON :: (Generic1 f, GFromJSON One (Rep1 f)) => Options -> Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (f a)
+ Data.Aeson.Safe: genericLiftToEncoding :: (Generic1 f, GToJSON' Encoding One (Rep1 f)) => Options -> (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> f a -> Encoding
+ Data.Aeson.Safe: genericLiftToJSON :: (Generic1 f, GToJSON' Value One (Rep1 f)) => Options -> (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> f a -> Value
+ Data.Aeson.Safe: genericParseJSON :: (Generic a, GFromJSON Zero (Rep a)) => Options -> Value -> Parser a
+ Data.Aeson.Safe: genericToEncoding :: (Generic a, GToJSON' Encoding Zero (Rep a)) => Options -> a -> Encoding
+ Data.Aeson.Safe: genericToJSON :: (Generic a, GToJSON' Value Zero (Rep a)) => Options -> a -> Value
+ Data.Aeson.Safe: genericToJSONKey :: (Generic a, GToJSONKey (Rep a)) => JSONKeyOptions -> ToJSONKeyFunction a
+ Data.Aeson.Safe: infixr 8 .=
+ Data.Aeson.Safe: liftOmitField :: ToJSON1 f => (a -> Bool) -> f a -> Bool
+ Data.Aeson.Safe: liftOmitField2 :: ToJSON2 f => (a -> Bool) -> (b -> Bool) -> f a b -> Bool
+ Data.Aeson.Safe: liftOmittedField :: FromJSON1 f => Maybe a -> Maybe (f a)
+ Data.Aeson.Safe: liftOmittedField2 :: FromJSON2 f => Maybe a -> Maybe b -> Maybe (f a b)
+ Data.Aeson.Safe: liftParseJSON :: FromJSON1 f => Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (f a)
+ Data.Aeson.Safe: liftParseJSON2 :: FromJSON2 f => Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Maybe b -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser (f a b)
+ Data.Aeson.Safe: liftParseJSONList :: FromJSON1 f => Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [f a]
+ Data.Aeson.Safe: liftParseJSONList2 :: FromJSON2 f => Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Maybe b -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser [f a b]
+ Data.Aeson.Safe: liftToEncoding :: ToJSON1 f => (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> f a -> Encoding
+ Data.Aeson.Safe: liftToEncoding2 :: ToJSON2 f => (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> (b -> Bool) -> (b -> Encoding) -> ([b] -> Encoding) -> f a b -> Encoding
+ Data.Aeson.Safe: liftToEncodingList :: ToJSON1 f => (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> [f a] -> Encoding
+ Data.Aeson.Safe: liftToEncodingList2 :: ToJSON2 f => (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> (b -> Bool) -> (b -> Encoding) -> ([b] -> Encoding) -> [f a b] -> Encoding
+ Data.Aeson.Safe: liftToJSON :: ToJSON1 f => (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> f a -> Value
+ Data.Aeson.Safe: liftToJSON2 :: ToJSON2 f => (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> (b -> Bool) -> (b -> Value) -> ([b] -> Value) -> f a b -> Value
+ Data.Aeson.Safe: liftToJSONList :: ToJSON1 f => (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> [f a] -> Value
+ Data.Aeson.Safe: liftToJSONList2 :: ToJSON2 f => (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> (b -> Bool) -> (b -> Value) -> ([b] -> Value) -> [f a b] -> Value
+ Data.Aeson.Safe: newtype AesonException
+ Data.Aeson.Safe: newtype DotNetTime
+ Data.Aeson.Safe: object :: [Pair] -> Value
+ Data.Aeson.Safe: omitField :: ToJSON a => a -> Bool
+ Data.Aeson.Safe: omitField1 :: (ToJSON1 f, ToJSON a) => f a -> Bool
+ Data.Aeson.Safe: omitField2 :: (ToJSON2 f, ToJSON a, ToJSON b) => f a b -> Bool
+ Data.Aeson.Safe: omittedField :: FromJSON a => Maybe a
+ Data.Aeson.Safe: omittedField1 :: (FromJSON1 f, FromJSON a) => Maybe (f a)
+ Data.Aeson.Safe: omittedField2 :: (FromJSON2 f, FromJSON a, FromJSON b) => Maybe (f a b)
+ Data.Aeson.Safe: pairs :: Series -> Encoding
+ Data.Aeson.Safe: parseEither :: (a -> Parser b) -> a -> Either String b
+ Data.Aeson.Safe: parseIndexedJSON :: (Value -> Parser a) -> Int -> Value -> Parser a
+ Data.Aeson.Safe: parseJSON1 :: (FromJSON1 f, FromJSON a) => Value -> Parser (f a)
+ Data.Aeson.Safe: parseJSON2 :: (FromJSON2 f, FromJSON a, FromJSON b) => Value -> Parser (f a b)
+ Data.Aeson.Safe: parseJSONList :: FromJSON a => Value -> Parser [a]
+ Data.Aeson.Safe: parseMaybe :: (a -> Parser b) -> a -> Maybe b
+ Data.Aeson.Safe: throwDecode :: (FromJSON a, MonadThrow m) => ByteString -> m a
+ Data.Aeson.Safe: throwDecode' :: (FromJSON a, MonadThrow m) => ByteString -> m a
+ Data.Aeson.Safe: throwDecodeStrict :: (FromJSON a, MonadThrow m) => ByteString -> m a
+ Data.Aeson.Safe: throwDecodeStrict' :: (FromJSON a, MonadThrow m) => ByteString -> m a
+ Data.Aeson.Safe: throwDecodeStrictText :: (FromJSON a, MonadThrow m) => Text -> m a
+ Data.Aeson.Safe: toEncoding :: ToJSON a => a -> Encoding
+ Data.Aeson.Safe: toEncoding1 :: (ToJSON1 f, ToJSON a) => f a -> Encoding
+ Data.Aeson.Safe: toEncoding2 :: (ToJSON2 f, ToJSON a, ToJSON b) => f a b -> Encoding
+ Data.Aeson.Safe: toEncodingList :: ToJSON a => [a] -> Encoding
+ Data.Aeson.Safe: toJSON1 :: (ToJSON1 f, ToJSON a) => f a -> Value
+ Data.Aeson.Safe: toJSON2 :: (ToJSON2 f, ToJSON a, ToJSON b) => f a b -> Value
+ Data.Aeson.Safe: toJSONKey :: ToJSONKey a => ToJSONKeyFunction a
+ Data.Aeson.Safe: toJSONKeyList :: ToJSONKey a => ToJSONKeyFunction [a]
+ Data.Aeson.Safe: toJSONList :: ToJSON a => [a] -> Value
+ Data.Aeson.Safe: type Array = Vector Value
+ Data.Aeson.Safe: type Encoding = Encoding' Value
+ Data.Aeson.Safe: type GToEncoding = GToJSON' Encoding
+ Data.Aeson.Safe: type GToJSON = GToJSON' Value
+ Data.Aeson.Safe: type JSONPath = [JSONPathElement]
+ Data.Aeson.Safe: type Object = KeyMap Value
+ Data.Aeson.Safe: withArray :: String -> (Array -> Parser a) -> Value -> Parser a
+ Data.Aeson.Safe: withBool :: String -> (Bool -> Parser a) -> Value -> Parser a
+ Data.Aeson.Safe: withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a
+ Data.Aeson.Safe: withObject :: String -> (Object -> Parser a) -> Value -> Parser a
+ Data.Aeson.Safe: withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a
+ Data.Aeson.Safe: withText :: String -> (Text -> Parser a) -> Value -> Parser a
+ Data.SafeJSON: ($dmsafeFrom) :: (SafeJSON a, FromJSON a) => Value -> Contained (Parser a)
+ Data.SafeJSON: ($dmsafeTo) :: (SafeJSON a, ToJSON a) => a -> Contained Value
+ Data.SafeJSON: ($dmtypeName) :: (SafeJSON a, Typeable a) => Proxy a -> String
- Data.SafeJSON: class SafeJSON (MigrateFrom a) => Migrate a where {
+ Data.SafeJSON: class SafeJSON MigrateFrom a => Migrate a where {
- Data.SafeJSON: safeFrom :: (SafeJSON a, FromJSON a) => Value -> Contained (Parser a)
+ Data.SafeJSON: safeFrom :: SafeJSON a => Value -> Contained (Parser a)
- Data.SafeJSON: safeFromJSON :: forall a. SafeJSON a => Value -> Parser a
+ Data.SafeJSON: safeFromJSON :: SafeJSON a => Value -> Parser a
- Data.SafeJSON: safeTo :: (SafeJSON a, ToJSON a) => a -> Contained Value
+ Data.SafeJSON: safeTo :: SafeJSON a => a -> Contained Value
- Data.SafeJSON: safeToJSON :: forall a. SafeJSON a => a -> Value
+ Data.SafeJSON: safeToJSON :: SafeJSON a => a -> Value
- Data.SafeJSON: setVersion :: forall a. SafeJSON a => Value -> Value
+ Data.SafeJSON: setVersion :: SafeJSON a => Value -> Value
- Data.SafeJSON: setVersion' :: forall a. SafeJSON a => Version a -> Value -> Value
+ Data.SafeJSON: setVersion' :: SafeJSON a => Version a -> Value -> Value
- Data.SafeJSON: typeName :: (SafeJSON a, Typeable a) => Proxy a -> String
+ Data.SafeJSON: typeName :: SafeJSON a => Proxy a -> String
- Data.SafeJSON: typeName1 :: forall t a. Typeable t => Proxy (t a) -> String
+ Data.SafeJSON: typeName1 :: Typeable t => Proxy (t a) -> String
- Data.SafeJSON: typeName2 :: forall t a b. Typeable t => Proxy (t a b) -> String
+ Data.SafeJSON: typeName2 :: Typeable t => Proxy (t a b) -> String
- Data.SafeJSON: typeName3 :: forall t a b c. Typeable t => Proxy (t a b c) -> String
+ Data.SafeJSON: typeName3 :: Typeable t => Proxy (t a b c) -> String
- Data.SafeJSON: typeName4 :: forall t a b c d. Typeable t => Proxy (t a b c d) -> String
+ Data.SafeJSON: typeName4 :: Typeable t => Proxy (t a b c d) -> String
- Data.SafeJSON: typeName5 :: forall t a b c d e. Typeable t => Proxy (t a b c d e) -> String
+ Data.SafeJSON: typeName5 :: Typeable t => Proxy (t a b c d e) -> String
- Data.SafeJSON.Test: data () => Proxy (t :: k)
+ Data.SafeJSON.Test: data Proxy (t :: k)
- Data.SafeJSON.Test: migrateReverseRoundTrip :: forall a. (Eq a, Show a, SafeJSON a, Migrate (Reverse a)) => MigrateFrom (Reverse a) -> Assertion
+ Data.SafeJSON.Test: migrateReverseRoundTrip :: (Eq a, Show a, SafeJSON a, Migrate (Reverse a)) => MigrateFrom (Reverse a) -> Assertion
- Data.SafeJSON.Test: migrateReverseRoundTripProp :: forall a b. TestReverseMigrate a b => String -> TestTree
+ Data.SafeJSON.Test: migrateReverseRoundTripProp :: TestReverseMigrate a b => String -> TestTree
- Data.SafeJSON.Test: migrateReverseRoundTripProp' :: forall a b. TestReverseMigrate a b => Proxy (a, b) -> String -> TestTree
+ Data.SafeJSON.Test: migrateReverseRoundTripProp' :: TestReverseMigrate a b => Proxy (a, b) -> String -> TestTree
- Data.SafeJSON.Test: migrateRoundTrip :: forall a. (Eq a, Show a, SafeJSON a, Migrate a) => MigrateFrom a -> Assertion
+ Data.SafeJSON.Test: migrateRoundTrip :: (Eq a, Show a, SafeJSON a, Migrate a) => MigrateFrom a -> Assertion
- Data.SafeJSON.Test: migrateRoundTripProp :: forall a b. TestMigrate a b => String -> TestTree
+ Data.SafeJSON.Test: migrateRoundTripProp :: TestMigrate a b => String -> TestTree
- Data.SafeJSON.Test: migrateRoundTripProp' :: forall a b. TestMigrate a b => Proxy (a, b) -> String -> TestTree
+ Data.SafeJSON.Test: migrateRoundTripProp' :: TestMigrate a b => Proxy (a, b) -> String -> TestTree
- Data.SafeJSON.Test: testConsistency :: forall a. SafeJSON a => Assertion
+ Data.SafeJSON.Test: testConsistency :: SafeJSON a => Assertion
- Data.SafeJSON.Test: testConsistency' :: forall a. SafeJSON a => Proxy a -> Assertion
+ Data.SafeJSON.Test: testConsistency' :: SafeJSON a => Proxy a -> Assertion
- Data.SafeJSON.Test: testRoundTrip :: forall a. (Show a, Eq a, SafeJSON a) => a -> Assertion
+ Data.SafeJSON.Test: testRoundTrip :: (Show a, Eq a, SafeJSON a) => a -> Assertion
- Data.SafeJSON.Test: testRoundTripProp :: forall a. (Eq a, Show a, Arbitrary a, SafeJSON a) => String -> TestTree
+ Data.SafeJSON.Test: testRoundTripProp :: (Eq a, Show a, Arbitrary a, SafeJSON a) => String -> TestTree
- Data.SafeJSON.Test: testRoundTripProp' :: forall a. (Eq a, Show a, Arbitrary a, SafeJSON a) => Proxy a -> String -> TestTree
+ Data.SafeJSON.Test: testRoundTripProp' :: (Eq a, Show a, Arbitrary a, SafeJSON a) => Proxy a -> String -> TestTree
- Data.SafeJSON.Test: type TestReverseMigrate a b = (Eq a, Show b, Arbitrary b, SafeJSON a, Migrate (Reverse a), MigrateFrom (Reverse a) ~ b)
+ Data.SafeJSON.Test: type TestReverseMigrate a b = (Eq a, Show b, Arbitrary b, SafeJSON a, Migrate Reverse a, MigrateFrom Reverse a ~ b)

Files

safe-json.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.0.+-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack  name:           safe-json-version:        1.2.1.0+version:        1.2.1.1 synopsis:       Automatic JSON format versioning description:    This library aims to make the updating of JSON formats or contents, while keeping backward compatibility, as painless as possible. The way this is achieved is through versioning and defined migration functions to migrate older (or newer) versions to the one used.                 .@@ -28,7 +28,7 @@ license-file:   LICENSE build-type:     Simple tested-with:-    GHC == 9.2.8 , GHC == 9.4.8 , GHC == 9.6.6 , GHC == 9.8.4 , GHC == 9.10.1+    GHC == 9.4.8 , GHC == 9.6.7 , GHC == 9.8.4 , GHC == 9.10.3 , GHC == 9.12.2 extra-source-files:     README.md     ChangeLog.md@@ -73,7 +73,7 @@     , tasty-hunit >=0.9.2 && <0.11     , tasty-quickcheck >=0.8.4 && <0.12     , text >=1.2.3 && <2.2-    , time >=1.6.0.1 && <1.15+    , time >=1.6.0.1 && <1.16     , unordered-containers >=0.2.9 && <0.3     , uuid-types >=1.0.3 && <1.1     , vector >=0.12.0.1 && <0.14@@ -105,7 +105,7 @@     , containers >=0.5.7.1 && <0.9     , dlist >=0.8.0.3 && <2     , hashable >=1.2.6.1 && <1.6-    , quickcheck-instances >=0.3.16 && <0.4+    , quickcheck-instances >=0.3.16 && <0.5     , safe-json     , scientific >=0.3.5.2 && <0.4     , tasty@@ -113,7 +113,7 @@     , tasty-quickcheck     , temporary >=1.2.1.1     , text >=1.2.3 && <2.2-    , time >=1.6.0.1 && <1.15+    , time >=1.6.0.1 && <1.16     , unordered-containers >=0.2.9 && <0.3     , uuid >=1.3.13     , uuid-types >=1.0.3 && <1.1
test/Instances.hs view
@@ -13,13 +13,30 @@ import qualified Data.Aeson.Key as K import qualified Data.Aeson.KeyMap as KM #endif-import Data.DList (DList, fromList, toList)+import Data.DList as DList (DList, fromList, toList) import Data.Int (Int64)+#if MIN_VERSION_quickcheck_instances(0,4,0)+import Data.List.NonEmpty as NonEmpty (NonEmpty, fromList, toList)+import Data.Semigroup as Semigroup (First (..), Last (..), Max (..), Min (..))+#endif import Data.Time (NominalDiffTime) import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import qualified Data.Vector.Primitive as VP+#if MIN_VERSION_quickcheck_instances(0,4,0)+import Numeric.Natural (Natural)+#endif -import Test.Tasty.QuickCheck (Arbitrary(..))+import Test.Tasty.QuickCheck (+  Arbitrary (..),+#if MIN_VERSION_quickcheck_instances(0,4,0)+  Arbitrary1 (..),+  arbitrary1,+  arbitrarySizedNatural,+  listOf1,+  shrink1,+  shrinkIntegral,+#endif+ ) #if !MIN_VERSION_aeson(2,0,3) import Test.Tasty.QuickCheck (oneof, resize) import Test.QuickCheck.Arbitrary.Generic (genericShrink)@@ -38,8 +55,8 @@   shrink = fmap DotNetTime . shrink . fromDotNetTime  instance Arbitrary a => Arbitrary (DList a) where-  arbitrary = fromList <$> arbitrary-  shrink = fmap fromList . shrink . toList+  arbitrary = DList.fromList <$> arbitrary+  shrink = fmap DList.fromList . shrink . DList.toList  #if !MIN_VERSION_quickcheck_instances(0,3,32) instance (Arbitrary a, VP.Prim a) => Arbitrary (VP.Vector a) where@@ -88,4 +105,34 @@   String{} `compare` _        = LT   Array{}  `compare` Object{} = LT   _        `compare` _        = GT+#endif++#if MIN_VERSION_quickcheck_instances(0,4,0)+instance Arbitrary1 NonEmpty where+  liftArbitrary arb = NonEmpty.fromList <$> listOf1 arb+  liftShrink shr xs = [ NonEmpty.fromList xs' | xs' <- liftShrink shr (NonEmpty.toList xs), not (null xs') ]++instance Arbitrary a => Arbitrary (NonEmpty a) where+  arbitrary = arbitrary1+  shrink = shrink1++instance Arbitrary a => Arbitrary (Semigroup.Min a) where+  arbitrary = fmap Semigroup.Min arbitrary+  shrink = map Semigroup.Min . shrink . Semigroup.getMin++instance Arbitrary a => Arbitrary (Semigroup.Max a) where+  arbitrary = fmap Semigroup.Max arbitrary+  shrink = map Semigroup.Max . shrink . Semigroup.getMax++instance Arbitrary a => Arbitrary (Semigroup.First a) where+  arbitrary = fmap Semigroup.First arbitrary+  shrink = map Semigroup.First . shrink . Semigroup.getFirst++instance Arbitrary a => Arbitrary (Semigroup.Last a) where+  arbitrary = fmap Semigroup.Last arbitrary+  shrink = map Semigroup.Last . shrink . Semigroup.getLast++instance Arbitrary Natural where+  arbitrary = arbitrarySizedNatural+  shrink    = shrinkIntegral #endif
test/PrimitiveTests.hs view
@@ -4,7 +4,6 @@ {-# LANGUAGE TypeApplications #-} module PrimitiveTests where - import Control.Applicative (Const) import Data.Aeson (DotNetTime, Value, (.:)) import qualified Data.Aeson as A