git.iko.soy/typeable/bloodhound
on master help sign in
CPP the Arbitrary instance for the 7.8 users
commit1467ffee929534242492ca3b6941e0bf7d84d66c authorChris Allen <cma@bitemyapp.com> dateSun 21 Aug 2016, 13:09 (10 years ago) parent8cff5d4
3 files changed+7−2
bloodhound.cabal+1−1 stack-7.8.yaml−1 tests/tests.hs+6
bloodhound.cabal+1−1
@@ -67,7 +67,7 @@ test-suite tests
6767 time,
6868 aeson,
6969 semigroups,
70− QuickCheck >= 2.8,
70+ QuickCheck,
7171 vector,
7272 unordered-containers >= 0.2.5.0 && <0.3,
7373 mtl,
stack-7.8.yaml−1
@@ -9,7 +9,6 @@ extra-deps:
99- http-types-0.9
1010- http-client-0.5.0
1111- attoparsec-0.13.0.1
12−- QuickCheck-2.8.2
1312- doctest-0.10.1
1413- doctest-prop-0.2.0.1
1514- quickcheck-properties-0.1
tests/tests.hs+6
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE DefaultSignatures #-}
23{-# LANGUAGE DeriveGeneric #-}
34{-# LANGUAGE FlexibleContexts #-}
@@ -585,6 +586,11 @@ noDuplicates xs = nub xs == xs
585586instance Arbitrary NominalDiffTime where
586587 arbitrary = fromInteger <$> arbitrary
587588
589+#if !MIN_VERSION_QuickCheck(2,8,0)
590+instance (Arbitrary k, Ord k, Arbitrary v) => Arbitrary (M.Map k v) where
591+ arbitrary = M.fromList <$> arbitrary
592+#endif
593+
588594instance Arbitrary Text where
589595 arbitrary = T.pack <$> arbitrary
590596