git.iko.soy/typeable/generic-arbitrary
on master help sign in
8 files changed+71−13
since splitsnapshots
unifiedsplit
.github/workflows/haskell-ci.yml+2−1 CHANGELOG.md+10 generic-arbitrary.cabal+12−10 ghc-9.8.1.yaml+1 ghc-9.8.1.yaml.lock+12 src/Test/QuickCheck/Arbitrary/Generic.hs+9−1 test/EnumTest.hs+24 test/RecursiveTest.hs+1−1
.github/workflows/haskell-ci.yml+2−1
@@ -1,5 +1,5 @@
11name: Haskell-CI
2−on: [push]
2+on: [push, pull_request]
33jobs:
44 linux:
55 name: GHC-${{ matrix.ghc-version }}
@@ -12,6 +12,7 @@ jobs:
1212 - 9.0.2
1313 - 9.2.4
1414 - 9.4.3
15+ - 9.8.1
1516 steps:
1617 - uses: actions/checkout@v3
1718 - uses: haskell/actions/setup@v2
CHANGELOG.md+10
@@ -1,3 +1,13 @@
1+1.0.1.2
2+-------
3+
4+* Fix dependency bounds (including retroactively), and compilation with warnings.
5+
6+1.0.1.1
7+-------
8+
9+* Fix compilation with GHC 9.8.3
10+
1111.0.1
212-----
313
generic-arbitrary.cabal+12−10
@@ -1,5 +1,5 @@
11name: generic-arbitrary
2−version: 1.0.1
2+version: 1.0.1.2
33synopsis: Generic implementation for QuickCheck's Arbitrary
44description:
55 Generic implementations of methods of the 'Arbitrary' class from the
@@ -16,11 +16,13 @@ category: Generic
1616build-type: Simple
1717extra-source-files: CHANGELOG.md
1818 , README.md
19−cabal-version: 1.22
19+cabal-version: 2.0
2020tested-with: GHC == 8.6.5
2121 , GHC == 8.10.7
2222 , GHC == 9.0.2
2323 , GHC == 9.2.4
24+ , GHC == 9.4.3
25+ , GHC == 9.8.1
2426
2527source-repository head
2628 type: git
@@ -29,7 +31,7 @@ source-repository head
2931library
3032 exposed-modules: Test.QuickCheck.Arbitrary.Generic
3133 build-depends: base >=4.8 && <5
32− , QuickCheck
34+ , QuickCheck >=2.8
3335 hs-source-dirs: src
3436 default-language: Haskell2010
3537 default-extensions: AllowAmbiguousTypes
@@ -57,15 +59,16 @@ test-suite test
5759 hs-source-dirs: test
5860 main-is: Test.hs
5961 default-language: Haskell2010
60− build-depends: base >= 4.8 && <5
61− , QuickCheck
62+ build-depends: base >=4.12 && <5
63+ , QuickCheck >=2.10
6264 , deepseq
6365 , generic-arbitrary
64− , tasty
65− , tasty-discover
66− , tasty-hunit
66+ , tasty >=1.4.2 || <1.4.0.1
67+ , tasty-discover >= 2.0.0
68+ , tasty-hunit >= 0.9.2
6769 , tasty-quickcheck
6870 other-modules: Auxiliary
71+ , EnumTest
6972 , LimitationDemo
7073 , NoTypecheckTest
7174 , ParametersTest
@@ -91,9 +94,8 @@ test-suite test
9194 , TypeSynonymInstances
9295 , UndecidableInstances
9396 , ViewPatterns
94− build-tools: tasty-discover
97+ build-tool-depends: tasty-discover:tasty-discover
9598 ghc-options: -Wall
9699 -threaded
97100 -rtsopts
98101 "-with-rtsopts=-N -A64m -qb0 -n4m -T -I1"
99− default-extensions: DeriveGeneric
ghc-9.8.1.yamlnew file+1
@@ -0,0 +1 @@
1+resolver: nightly-2024-01-12
ghc-9.8.1.yaml.locknew file+12
@@ -0,0 +1,12 @@
1+# This file was autogenerated by Stack.
2+# You should not edit this file by hand.
3+# For more information, please see the documentation at:
4+# https://docs.haskellstack.org/en/stable/lock_files
5+
6+packages: []
7+snapshots:
8+- completed:
9+ sha256: 8f06e87750f95bc8620644ea22344ad023c3c5aa6efa854747aa70093898fd79
10+ size: 556465
11+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2024/1/12.yaml
12+ original: nightly-2024-01-12
src/Test/QuickCheck/Arbitrary/Generic.hs+9−1
@@ -1,3 +1,10 @@
1+#if __GLASGOW_HASKELL__ >= 806
2+{-# OPTIONS_GHC -Wno-star-is-type #-}
3+#endif
4+#if __GLASGOW_HASKELL__ >= 800
5+{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
6+#endif
7+
18{-|
29
310This module is a generic implementation of the 'arbitrary' method. Example
@@ -146,13 +153,14 @@ module Test.QuickCheck.Arbitrary.Generic
146153 ) where
147154
148155import Control.Applicative
149−import Data.Coerce (coerce)
150156import Data.Proxy
151157import Data.Type.Bool
152158import GHC.Generics as G
153159import GHC.TypeLits
160+import Prelude
154161import Test.QuickCheck as QC
155162#if MIN_VERSION_QuickCheck(2, 14, 0)
163+import Data.Coerce (coerce)
156164import Test.QuickCheck.Arbitrary (GSubterms, RecursivelyShrink)
157165
158166
test/EnumTest.hsnew file+24
@@ -0,0 +1,24 @@
1+#if __GLASGOW_HASKELL__ >= 806 && __GLASGOW_HASKELL__ <= 900
2+{-# OPTIONS_GHC -fconstraint-solver-iterations=5 #-}
3+#elif __GLASGOW_HASKELL__ >= 902
4+{-# OPTIONS_GHC -fconstraint-solver-iterations=6 #-}
5+#endif
6+
7+
8+
9+module EnumTest where
10+
11+import Control.DeepSeq
12+import GHC.Generics
13+import Test.QuickCheck
14+import Test.QuickCheck.Arbitrary.Generic
15+
16+data Country = PL | GB | RU | RO | CZ | HR | SK | DE | NL | ES | BR
17+ deriving (Generic, NFData, Show)
18+
19+instance Arbitrary Country where
20+ arbitrary = genericArbitrary
21+ shrink = genericShrink
22+
23+prop_CountryTest :: Country -> Property
24+prop_CountryTest = total
test/RecursiveTest.hs+1−1
@@ -8,7 +8,7 @@
88
99module RecursiveTest where
1010
11−import Control.DeepSeq
11+import Control.DeepSeq (NFData)
1212import GHC.Generics (Generic)
1313import Test.QuickCheck
1414import Test.QuickCheck.Arbitrary.Generic