CPP the Arbitrary instance for the 7.8 users

This commit is contained in:
Chris Allen 2016-08-21 13:09:03 -05:00
parent 8cff5d4488
commit 1467ffee92
3 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,7 @@ test-suite tests
time,
aeson,
semigroups,
QuickCheck >= 2.8,
QuickCheck,
vector,
unordered-containers >= 0.2.5.0 && <0.3,
mtl,

View File

@ -9,7 +9,6 @@ extra-deps:
- http-types-0.9
- http-client-0.5.0
- attoparsec-0.13.0.1
- QuickCheck-2.8.2
- doctest-0.10.1
- doctest-prop-0.2.0.1
- quickcheck-properties-0.1

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
@ -585,6 +586,11 @@ noDuplicates xs = nub xs == xs
instance Arbitrary NominalDiffTime where
arbitrary = fromInteger <$> arbitrary
#if !MIN_VERSION_QuickCheck(2,8,0)
instance (Arbitrary k, Ord k, Arbitrary v) => Arbitrary (M.Map k v) where
arbitrary = M.fromList <$> arbitrary
#endif
instance Arbitrary Text where
arbitrary = T.pack <$> arbitrary