Skip to content

Commit e264cad

Browse files
authored
Merge pull request #585 from bos/qc
Remove support for old QuickCheck versions
2 parents a3f3260 + 3c2fe49 commit e264cad

File tree

5 files changed

+10
-62
lines changed

5 files changed

+10
-62
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ matrix:
2525
- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 STACK_YAML=stack-bench.yaml
2626
compiler: ": #GHC 8.0.2"
2727
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
28-
- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 STACK_YAML=stack-pure-unescape.yaml
28+
- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 STACK_YAML=stack-ffi-unescape.yaml
2929
compiler: ": #GHC 8.0.2"
3030
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
3131
- env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2

aeson.cabal

Lines changed: 2 additions & 2 deletions
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.11,
202+
QuickCheck >= 2.10.0.1 && < 2.11,
203203
aeson,
204204
integer-logarithms >= 1 && <1.1,
205205
attoparsec,
@@ -226,7 +226,7 @@ test-suite tests
226226
unordered-containers,
227227
uuid-types,
228228
vector,
229-
quickcheck-instances >=0.3.14
229+
quickcheck-instances >= 0.3.16
230230

231231
if flag(bytestring-builder)
232232
build-depends: bytestring >= 0.9 && < 0.10.4,

stack-ffi-unescape.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resolver: nightly-2017-09-04
2+
packages:
3+
- '.'
4+
flags:
5+
aeson:
6+
fast: true
7+
cffi: true

stack-pure-unescape.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/Instances.hs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,12 @@ import Types
2222
import qualified Data.DList as DList
2323
import qualified Data.HashMap.Strict as HM
2424

25-
#if !MIN_VERSION_QuickCheck(2,9,0)
26-
import Control.Applicative (Const(..))
27-
import Data.Functor.Identity (Identity (..))
28-
import Data.List.NonEmpty (NonEmpty(..))
29-
import Data.Version
30-
import Test.QuickCheck (getNonNegative, listOf1, resize)
31-
#endif
32-
33-
#if !MIN_VERSION_QuickCheck(2,10,0)
34-
import Data.Functor.Compose (Compose (..))
35-
import Data.Proxy (Proxy(..))
36-
#endif
37-
3825
import Data.Orphans ()
3926
import Test.QuickCheck.Instances ()
4027
#if MIN_VERSION_base(4,7,0)
4128
import Data.Hashable.Time ()
4229
#endif
4330

44-
#if !MIN_VERSION_base(4,8,0) && !MIN_VERSION_QuickCheck(2,8,3)
45-
import Numeric.Natural
46-
#endif
47-
4831
{-# ANN module ("HLint: ignore Use fewer imports"::String) #-}
4932

5033
-- "System" types.
@@ -186,37 +169,5 @@ instance (ApproxEq a) => ApproxEq [a] where
186169
-- a definition is given below.
187170

188171

189-
#if !MIN_VERSION_base(4,8,0) && !MIN_VERSION_QuickCheck(2,8,3)
190-
instance Arbitrary Natural where
191-
arbitrary = fromInteger . abs <$> arbitrary
192-
#endif
193-
194-
#if !MIN_VERSION_QuickCheck(2,10,0)
195-
instance Arbitrary (Proxy a) where
196-
arbitrary = pure Proxy
197-
198-
instance Arbitrary (f (g a)) => Arbitrary (Compose f g a) where
199-
arbitrary = Compose <$> arbitrary
200-
#endif
201-
202172
instance Arbitrary a => Arbitrary (DList.DList a) where
203173
arbitrary = DList.fromList <$> arbitrary
204-
205-
#if !MIN_VERSION_QuickCheck(2,9,0)
206-
instance Arbitrary a => Arbitrary (Const a b) where
207-
arbitrary = Const <$> arbitrary
208-
209-
instance Arbitrary a => Arbitrary (NonEmpty a) where
210-
arbitrary = (:|) <$> arbitrary <*> arbitrary
211-
212-
instance Arbitrary Version where
213-
arbitrary = makeVersion . fmap getNonNegative <$> resize 4 (listOf1 arbitrary)
214-
215-
#if !MIN_VERSION_base(4,8,0)
216-
makeVersion :: [Int] -> Version
217-
makeVersion b = Version b []
218-
#endif
219-
220-
instance Arbitrary a => Arbitrary (Identity a) where
221-
arbitrary = Identity <$> arbitrary
222-
#endif

0 commit comments

Comments
 (0)