@@ -142,12 +142,17 @@ instance ApproxEq Char where
142instance (ApproxEq a) => ApproxEq [a] where
142instance (ApproxEq a) => ApproxEq [a] where
143 a =~ b = length a == length b && all (uncurry (=~)) (zip a b)
143 a =~ b = length a == length b && all (uncurry (=~)) (zip a b)
145+#if !MIN_VERSION_QuickCheck(2,9,0)
145instance Arbitrary Version where
146instance Arbitrary Version where
146 arbitrary = makeVersion . fmap getNonNegative <$> resize 4 (listOf1 arbitrary)
147 arbitrary = makeVersion . fmap getNonNegative <$> resize 4 (listOf1 arbitrary)
148instance Arbitrary a => Arbitrary (NonEmpty a) where
149instance Arbitrary a => Arbitrary (NonEmpty a) where
149 arbitrary = (:|) <$> arbitrary <*> arbitrary
150 arbitrary = (:|) <$> arbitrary <*> arbitrary
152+instance Arbitrary a => Arbitrary (Const a b) where
153+ arbitrary = Const <$> arbitrary
151-- Version tags are deprecated, so we avoid using them in the Arbitrary
156-- Version tags are deprecated, so we avoid using them in the Arbitrary
152-- instance. However, the recommended constructor 'makeVersion' is not
157-- instance. However, the recommended constructor 'makeVersion' is not
153-- exported by "Data.Version" until base-4.8.0.0. For previous versions,
158-- exported by "Data.Version" until base-4.8.0.0. For previous versions,
@@ -168,6 +173,3 @@ instance Arbitrary (Proxy a) where
169instance Arbitrary b => Arbitrary (Tagged a b) where
174instance Arbitrary b => Arbitrary (Tagged a b) where
170 arbitrary = Tagged <$> arbitrary
175 arbitrary = Tagged <$> arbitrary
172−instance Arbitrary a => Arbitrary (Const a b) where
173− arbitrary = Const <$> arbitrary