Merge branch 'fix-instances' into older-quickcheck
commit84c62a4de517c78e5080f5451714ce7944987ba6
authorAleksey Uymanov <s9gf4ult@gmail.com>
dateTue 3 Aug 2021, 18:16 (5 years ago)
parentbcf174e5d2ef0a
CHANGELOG.md+2−1
@@ -1,8 +1,9 @@
1−0.3.0
1+1.0.0
22-----
33
44* Fixed issue with too big terms in case of recursive types
55* Recpect the `size` argument
6+* Types with parameters require `Arg` now
67
780.2.0
89-----
README.md+17
@@ -19,3 +19,20 @@ instance Arbitrary Expr where
1919 arbitrary = genericArbitrary
2020 shrink = genericShrink
2121```
22+
23+if type has an argument then `Arg` is required
24+
25+``` haskell
26+data Expr lit
27+ = Lit lit
28+ | Add Expr Expr
29+ | Mul Expr Expr
30+ deriving (Eq, Show, Generic)
31+
32+instance
33+ ( Arbitrary lit
34+ , Arg (Expr lit) lit
35+ ) => Arbitrary (Expr lit) where
36+ arbitrary = genericArbitrary
37+ shrink = genericShrink
38+```
generic-arbitrary.cabal+1−1
@@ -1,5 +1,5 @@
11name: generic-arbitrary
2−version: 0.3.0
2+version: 1.0.0
33synopsis: Generic implementation for QuickCheck's Arbitrary
44description:
55 Generic implementations of methods of the 'Arbitrary' class from the