Skip to content

Commit de79f6b

Browse files
authored
Merge pull request #555 from bos/qc-210
Allow QuickCheck 2.10.*
2 parents 5fd9078 + 831179c commit de79f6b

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

aeson.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ test-suite tests
199199

200200
build-depends:
201201
HUnit,
202-
QuickCheck >= 2.8 && <2.9.3,
202+
QuickCheck >= 2.8 && <2.11,
203203
aeson,
204204
integer-logarithms >= 1 && <1.1,
205205
attoparsec,

tests/Instances.hs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import Control.Applicative (empty)
1414
import Control.Monad
1515
import Data.Aeson.Types
1616
import Data.Function (on)
17-
import Data.Functor.Compose (Compose (..))
18-
import Data.Proxy (Proxy(..))
1917
import Data.Time (ZonedTime(..), TimeZone(..))
2018
import Data.Time.Clock (UTCTime(..))
2119
import Functions
@@ -32,6 +30,11 @@ import Data.Version
3230
import Test.QuickCheck (getNonNegative, listOf1, resize)
3331
#endif
3432

33+
#if !MIN_VERSION_QuickCheck(2,10,0)
34+
import Data.Functor.Compose (Compose (..))
35+
import Data.Proxy (Proxy(..))
36+
#endif
37+
3538
import Data.Orphans ()
3639
import Test.QuickCheck.Instances ()
3740
#if MIN_VERSION_base(4,7,0)
@@ -188,14 +191,16 @@ instance Arbitrary Natural where
188191
arbitrary = fromInteger . abs <$> arbitrary
189192
#endif
190193

194+
#if !MIN_VERSION_QuickCheck(2,10,0)
191195
instance Arbitrary (Proxy a) where
192196
arbitrary = pure Proxy
193197

194-
instance Arbitrary a => Arbitrary (DList.DList a) where
195-
arbitrary = DList.fromList <$> arbitrary
196-
197198
instance Arbitrary (f (g a)) => Arbitrary (Compose f g a) where
198199
arbitrary = Compose <$> arbitrary
200+
#endif
201+
202+
instance Arbitrary a => Arbitrary (DList.DList a) where
203+
arbitrary = DList.fromList <$> arbitrary
199204

200205
#if !MIN_VERSION_QuickCheck(2,9,0)
201206
instance Arbitrary a => Arbitrary (Const a b) where

0 commit comments

Comments
 (0)