git.iko.soy/typeable/swagger2
on master help sign in
Don't define Arbitrary for container instances when QuickCheck >=2.8.2
commit66f50056751916ff70ea4eff74236fb36c9bad54 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateTue 26 Jan 2016, 18:43 (11 years ago) parentcb43d01
1 file changed+7−4
test/Data/Swagger/Schema/ValidationSpec.hs+7−4
test/Data/Swagger/Schema/ValidationSpec.hs+7−4
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE PackageImports #-}
23module Data.Swagger.Schema.ValidationSpec where
34
@@ -79,18 +80,20 @@ spec = do
7980main :: IO ()
8081main = hspec spec
8182
82−
83+#if MIN_VERSION_QuickCheck(2,8,2)
84+#else
8385instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) where
8486 arbitrary = Map.fromList <$> arbitrary
8587
86−instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
87− arbitrary = HashMap.fromList <$> arbitrary
88−
8988instance Arbitrary a => Arbitrary (IntMap a) where
9089 arbitrary = IntMap.fromList <$> arbitrary
9190
9291instance (Ord a, Arbitrary a) => Arbitrary (Set a) where
9392 arbitrary = Set.fromList <$> arbitrary
93+#endif
94+
95+instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
96+ arbitrary = HashMap.fromList <$> arbitrary
9497
9598instance (Eq a, Hashable a, Arbitrary a) => Arbitrary (HashSet a) where
9699 arbitrary = HashSet.fromList <$> arbitrary