on master help sign in
Merge pull request #459 from phadej/quickcheck-2.9-aeson-0.11-fix

Fix quickcheck-2.9 support for aeson-0.11

commitf23b3e91d980c4bd1842ba0202f577f37e6403f5 authorAdam Bergmark <adam@bergmark.nl> dateSun 7 Aug 2016, 14:17 (10 years ago) parentc4a27ef80b6bff
1 file changed+5−3
tests/Instances.hs+5−3
tests/Instances.hs+5−3
@@ -142,12 +142,17 @@ instance ApproxEq Char where
142142instance (ApproxEq a) => ApproxEq [a] where
143143 a =~ b = length a == length b && all (uncurry (=~)) (zip a b)
144144
145+#if !MIN_VERSION_QuickCheck(2,9,0)
145146instance Arbitrary Version where
146147 arbitrary = makeVersion . fmap getNonNegative <$> resize 4 (listOf1 arbitrary)
147148
148149instance Arbitrary a => Arbitrary (NonEmpty a) where
149150 arbitrary = (:|) <$> arbitrary <*> arbitrary
150151
152+instance Arbitrary a => Arbitrary (Const a b) where
153+ arbitrary = Const <$> arbitrary
154+#endif
155+
151156-- Version tags are deprecated, so we avoid using them in the Arbitrary
152157-- instance. However, the recommended constructor 'makeVersion' is not
153158-- exported by "Data.Version" until base-4.8.0.0. For previous versions,
@@ -168,6 +173,3 @@ instance Arbitrary (Proxy a) where
168173
169174instance Arbitrary b => Arbitrary (Tagged a b) where
170175 arbitrary = Tagged <$> arbitrary
171−
172−instance Arbitrary a => Arbitrary (Const a b) where
173− arbitrary = Const <$> arbitrary