on master help sign in
Merge pull request #555 from bos/qc-210

Allow QuickCheck 2.10.*

commitde79f6b9c756e2087e370f0176f3017d5b32a5ba authorAdam Bergmark <adam@bergmark.nl> dateSat 22 Jul 2017, 04:32 (9 years ago) parent5fd9078831179c
2 files changed+11−6
aeson.cabal+1−1 tests/Instances.hs+10−5
aeson.cabal+1−1
@@ -199,7 +199,7 @@ test-suite tests
199199
200200 build-depends:
201201 HUnit,
202− QuickCheck >= 2.8 && <2.9.3,
202+ QuickCheck >= 2.8 && <2.11,
203203 aeson,
204204 integer-logarithms >= 1 && <1.1,
205205 attoparsec,
tests/Instances.hs+10−5
@@ -14,8 +14,6 @@ import Control.Applicative (empty)
1414import Control.Monad
1515import Data.Aeson.Types
1616import Data.Function (on)
17−import Data.Functor.Compose (Compose (..))
18−import Data.Proxy (Proxy(..))
1917import Data.Time (ZonedTime(..), TimeZone(..))
2018import Data.Time.Clock (UTCTime(..))
2119import Functions
@@ -32,6 +30,11 @@ import Data.Version
3230import Test.QuickCheck (getNonNegative, listOf1, resize)
3331#endif
3432
33+#if !MIN_VERSION_QuickCheck(2,10,0)
34+import Data.Functor.Compose (Compose (..))
35+import Data.Proxy (Proxy(..))
36+#endif
37+
3538import Data.Orphans ()
3639import Test.QuickCheck.Instances ()
3740#if MIN_VERSION_base(4,7,0)
@@ -188,14 +191,16 @@ instance Arbitrary Natural where
188191 arbitrary = fromInteger . abs <$> arbitrary
189192#endif
190193
194+#if !MIN_VERSION_QuickCheck(2,10,0)
191195instance Arbitrary (Proxy a) where
192196 arbitrary = pure Proxy
193197
194−instance Arbitrary a => Arbitrary (DList.DList a) where
195− arbitrary = DList.fromList <$> arbitrary
196−
197198instance Arbitrary (f (g a)) => Arbitrary (Compose f g a) where
198199 arbitrary = Compose <$> arbitrary
200+#endif
201+
202+instance Arbitrary a => Arbitrary (DList.DList a) where
203+ arbitrary = DList.fromList <$> arbitrary
199204
200205#if !MIN_VERSION_QuickCheck(2,9,0)
201206instance Arbitrary a => Arbitrary (Const a b) where