git.iko.soy/typeable/generic-arbitrary
on master help sign in
Merge branch 'bugfix/enums'
commit450ebba86319a8cc7255be9ab0f2ba2281f489b3 authorAleksey Uymanov <s9gf4ult@gmail.com> dateTue 16 Jan 2024, 12:21 (3 years ago) parentccf2c0de925bf4
7 files changed+53
.github/workflows/haskell-ci.yml+2 generic-arbitrary.cabal+1 ghc-9.4.3.yaml+1 ghc-9.4.3.yaml.lock+12 ghc-9.8.1.yaml+1 ghc-9.8.1.yaml.lock+12 test/EnumTest.hs+24
.github/workflows/haskell-ci.yml+2
@@ -11,6 +11,8 @@ jobs:
1111 - 8.10.7
1212 - 9.0.2
1313 - 9.2.4
14+ - 9.4.3
15+ - 9.8.1
1416 steps:
1517 - uses: actions/checkout@v3
1618 - uses: haskell/actions/setup@v2
generic-arbitrary.cabal+1
@@ -66,6 +66,7 @@ test-suite test
6666 , tasty-hunit
6767 , tasty-quickcheck
6868 other-modules: Auxiliary
69+ , EnumTest
6970 , LimitationDemo
7071 , NoTypecheckTest
7172 , ParametersTest
ghc-9.4.3.yamlnew file+1
@@ -0,0 +1 @@
1+resolver: nightly-2022-12-26
ghc-9.4.3.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: bbe432b2abd6d866aa37f65a8129a5f858b7c6eaae9464f8bc2814ce92ac2d15
10+ size: 573163
11+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/12/26.yaml
12+ original: nightly-2022-12-26
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
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 && __GLASGOW_HASKELL__ <= 908
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