summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNickSmallbone <>2020-07-05 12:23:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-07-05 12:23:00 (GMT)
commitfe3bb7e686b1dad40ec49b105666634527ace53b (patch)
treee82fc44da6822c97f74420ce09cf0ebb58d02baa
parent9398621461fa26763e1e3ba87248bac4c1a4865d (diff)
version 2.14.1HEAD2.14.1master
-rw-r--r--QuickCheck.cabal64
-rw-r--r--[-rwxr-xr-x]Setup.lhs0
-rw-r--r--changelog7
-rw-r--r--examples/Heap.hs4
-rwxr-xr-xmake-hugs19
-rw-r--r--src/Test/QuickCheck.hs (renamed from Test/QuickCheck.hs)0
-rw-r--r--src/Test/QuickCheck/All.hs (renamed from Test/QuickCheck/All.hs)0
-rw-r--r--src/Test/QuickCheck/Arbitrary.hs (renamed from Test/QuickCheck/Arbitrary.hs)0
-rw-r--r--src/Test/QuickCheck/Exception.hs (renamed from Test/QuickCheck/Exception.hs)0
-rw-r--r--src/Test/QuickCheck/Features.hs (renamed from Test/QuickCheck/Features.hs)0
-rw-r--r--src/Test/QuickCheck/Function.hs (renamed from Test/QuickCheck/Function.hs)0
-rw-r--r--src/Test/QuickCheck/Gen.hs (renamed from Test/QuickCheck/Gen.hs)4
-rw-r--r--src/Test/QuickCheck/Gen/Unsafe.hs (renamed from Test/QuickCheck/Gen/Unsafe.hs)0
-rw-r--r--src/Test/QuickCheck/Modifiers.hs (renamed from Test/QuickCheck/Modifiers.hs)0
-rw-r--r--src/Test/QuickCheck/Monadic.hs (renamed from Test/QuickCheck/Monadic.hs)0
-rw-r--r--src/Test/QuickCheck/Poly.hs (renamed from Test/QuickCheck/Poly.hs)0
-rw-r--r--src/Test/QuickCheck/Property.hs (renamed from Test/QuickCheck/Property.hs)12
-rw-r--r--src/Test/QuickCheck/Random.hs (renamed from Test/QuickCheck/Random.hs)32
-rw-r--r--src/Test/QuickCheck/State.hs (renamed from Test/QuickCheck/State.hs)0
-rw-r--r--src/Test/QuickCheck/Test.hs (renamed from Test/QuickCheck/Test.hs)16
-rw-r--r--src/Test/QuickCheck/Text.hs (renamed from Test/QuickCheck/Text.hs)0
-rwxr-xr-xtest-hugs26
-rw-r--r--tests/GCoArbitraryExample.hs2
-rw-r--r--tests/GShrinkExample.hs2
24 files changed, 152 insertions, 36 deletions
diff --git a/QuickCheck.cabal b/QuickCheck.cabal
index 0958f44..9fb6f02 100644
--- a/QuickCheck.cabal
+++ b/QuickCheck.cabal
@@ -1,6 +1,6 @@
Name: QuickCheck
-Version: 2.14
-Cabal-Version: >= 1.8
+Version: 2.14.1
+Cabal-Version: >= 1.10
Build-type: Simple
License: BSD3
License-file: LICENSE
@@ -8,7 +8,7 @@ Copyright: 2000-2019 Koen Claessen, 2006-2008 Björn Bringert, 2009-2019 Nick Sm
Author: Koen Claessen <koen@chalmers.se>
Maintainer: Nick Smallbone <nick@smallbone.se>
Bug-reports: https://github.com/nick8325/quickcheck/issues
-Tested-with: GHC >= 7.0
+Tested-with: GHC ==7.0.4 || ==7.2.2 || >= 7.4
Homepage: https://github.com/nick8325/quickcheck
Category: Testing
Synopsis: Automatic testing of Haskell programs
@@ -48,6 +48,7 @@ extra-source-files:
examples/Set.hs
examples/Simple.hs
make-hugs
+ test-hugs
source-repository head
type: git
@@ -56,22 +57,36 @@ source-repository head
source-repository this
type: git
location: https://github.com/nick8325/quickcheck
- tag: 2.14
+ tag: 2.14.1
flag templateHaskell
Description: Build Test.QuickCheck.All, which uses Template Haskell.
Default: True
+flag old-random
+ Description: Build against a pre-1.2.0 version of the random package.
+ Default: False
+
library
- Build-depends: base >=4.3 && <5, random >=1.0.0.3 && <1.2, containers
+ Hs-source-dirs: src
+ Build-depends: base >=4.3 && <5, containers
+ Default-language: Haskell2010
+
+ -- New vs old random.
+ if flag(old-random)
+ Build-depends: random >= 1.0.0.3 && < 1.2.0
+ cpp-options: -DOLD_RANDOM
+ else
+ Build-depends: random >= 1.2.0 && < 1.3
- -- random is explicitly Trustworthy since 1.0.1.0
- -- similar constraint for containers
- -- Note: QuickCheck is Safe only with GHC >= 7.4 (see below)
- if impl(ghc >= 7.2)
- Build-depends: random >=1.0.1.0
- if impl(ghc >= 7.4)
- Build-depends: containers >=0.4.2.1
+ -- We always use splitmix directly rather than going through StdGen
+ -- (it's somewhat more efficient).
+ -- However, Hugs traps overflow on Word64, so we have to stick
+ -- with StdGen there.
+ if impl(hugs)
+ cpp-options: -DNO_SPLITMIX
+ else
+ Build-depends: splitmix >= 0.1 && <0.2
-- Modules that are always built.
Exposed-Modules:
@@ -118,11 +133,12 @@ library
if impl (ghc < 7.4)
cpp-options: -DNO_SAFE_HASKELL
- -- Use splitmix on newer GHCs.
- if impl(ghc >= 7.0)
- Build-depends: splitmix >= 0.0.4
- else
- cpp-options: -DNO_SPLITMIX
+ -- random is explicitly Trustworthy since 1.0.1.0
+ -- similar constraint for containers
+ if impl(ghc >= 7.2)
+ Build-depends: random >=1.0.1.0
+ if impl(ghc >= 7.4)
+ Build-depends: containers >=0.4.2.1
if !impl(ghc >= 7.6)
cpp-options: -DNO_POLYKINDS
@@ -134,13 +150,15 @@ library
if !impl(ghc)
-- If your Haskell compiler can cope without some of these, please
-- send a message to the QuickCheck mailing list!
- cpp-options: -DNO_TIMEOUT -DNO_NEWTYPE_DERIVING -DNO_GENERICS -DNO_TEMPLATE_HASKELL -DNO_SAFE_HASKELL -DNO_TYPEABLE -DNO_GADTS -DNO_EXTRA_METHODS_IN_APPLICATIVE
+ cpp-options: -DNO_TIMEOUT -DNO_NEWTYPE_DERIVING -DNO_GENERICS
+ -DNO_TEMPLATE_HASKELL -DNO_SAFE_HASKELL -DNO_TYPEABLE -DNO_GADTS
+ -DNO_EXTRA_METHODS_IN_APPLICATIVE -DOLD_RANDOM
if !impl(hugs) && !impl(uhc)
cpp-options: -DNO_ST_MONAD -DNO_MULTI_PARAM_TYPE_CLASSES
-- LANGUAGE pragmas don't have any effect in Hugs.
if impl(hugs)
- Extensions: CPP
+ Default-Extensions: CPP
if impl(uhc)
-- Cabal under UHC needs pointing out all the dependencies of the
@@ -151,6 +169,7 @@ library
Test-Suite test-quickcheck
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs:
examples
main-is: Heap.hs
@@ -160,6 +179,7 @@ Test-Suite test-quickcheck
Test-Suite test-quickcheck-gcoarbitrary
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: GCoArbitraryExample.hs
build-depends: base, QuickCheck
@@ -170,6 +190,7 @@ Test-Suite test-quickcheck-gcoarbitrary
Test-Suite test-quickcheck-generators
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: Generators.hs
build-depends: base, QuickCheck
@@ -178,6 +199,7 @@ Test-Suite test-quickcheck-generators
Test-Suite test-quickcheck-gshrink
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: GShrinkExample.hs
build-depends: base, QuickCheck
@@ -188,6 +210,7 @@ Test-Suite test-quickcheck-gshrink
Test-Suite test-quickcheck-terminal
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: Terminal.hs
build-depends: base, process, deepseq >= 1.1.0.0, QuickCheck
@@ -196,6 +219,7 @@ Test-Suite test-quickcheck-terminal
Test-Suite test-quickcheck-monadfix
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: MonadFix.hs
build-depends: base, QuickCheck
@@ -204,12 +228,14 @@ Test-Suite test-quickcheck-monadfix
Test-Suite test-quickcheck-split
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: Split.hs
build-depends: base, QuickCheck
Test-Suite test-quickcheck-misc
type: exitcode-stdio-1.0
+ Default-language: Haskell2010
hs-source-dirs: tests
main-is: Misc.hs
build-depends: base, QuickCheck
diff --git a/Setup.lhs b/Setup.lhs
index e2c31e7..e2c31e7 100755..100644
--- a/Setup.lhs
+++ b/Setup.lhs
diff --git a/changelog b/changelog
index 2a8876e..fed840a 100644
--- a/changelog
+++ b/changelog
@@ -1,4 +1,7 @@
-QuickCheck 2.14 (release 2020-03-28)
+QuickCheck 2.14.1 (release 2020-07-05)
+ * Compatibility with random >= 1.2.
+
+QuickCheck 2.14 (released 2020-03-28)
* QuickCheck is now much faster at generating test data!
As a result, many properties can now be tested a lot faster;
the examples distributed with QuickCheck run about twice as
@@ -31,7 +34,7 @@ QuickCheck 2.14 (release 2020-03-28)
- When a call to 'within' fails, include the duration of the
timeout in the failure report (thanks to William Rusnack).
- In Gen, avoid splitting the seed in the implementation of
- >>, *> and <- (thanks to David Feuer).
+ >>, *> and <* (thanks to David Feuer).
- Fix a couple of bugs with shrinking of floating-point
numbers.
- Export functionMapWith, functionEitherWith and
diff --git a/examples/Heap.hs b/examples/Heap.hs
index c3900a9..fb334f0 100644
--- a/examples/Heap.hs
+++ b/examples/Heap.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-}
module Main where
+import Data.Int
+
--------------------------------------------------------------------------
-- imports
@@ -144,7 +146,7 @@ instance (Ord a, Arbitrary a) => Arbitrary (Heap a) where
-- main
return []
-main = $quickCheckAll
+main = $forAllProperties (quickCheckWithResult stdArgs{maxSuccess = 10000})
--------------------------------------------------------------------------
-- the end.
diff --git a/make-hugs b/make-hugs
index f4bda04..46da6bf 100755
--- a/make-hugs
+++ b/make-hugs
@@ -1,16 +1,25 @@
#!/bin/bash
-cd $(dirname $0)
-for i in $(find Test -name '*.hs'); do
- mkdir -p quickcheck-hugs/$(dirname $i)
+
+set -e
+
+TOPDIR=$(dirname "$0")
+TARGETDIR=$TOPDIR/quickcheck-hugs
+
+find "$TOPDIR/src" -name '*.hs' | while read -r src; do
+ tgt="$TARGETDIR/$(echo "$src" | sed "s/^$TOPDIR\/src"'//')"
+
+ echo "Processing $src -> $tgt"
+
+ mkdir -p "$(dirname "$tgt")"
# If you want to switch on and off other features, look in
# QuickCheck.cabal to see what's available, or submit a patch
# adding a new -DNO_... flag.
- cpphs --noline -DNO_SPLITMIX -DNO_TEMPLATE_HASKELL \
+ cpphs --noline -DOLD_RANDOM -DNO_SPLITMIX -DNO_TEMPLATE_HASKELL \
-DNO_CTYPES_CONSTRUCTORS -DNO_FOREIGN_C_USECONDS -DNO_GENERICS \
-DNO_SAFE_HASKELL -DNO_POLYKINDS -DNO_MONADFAIL -DNO_TIMEOUT \
-DNO_NEWTYPE_DERIVING -DNO_TYPEABLE -DNO_GADTS -DNO_TRANSFORMERS \
-DNO_DEEPSEQ -DNO_EXTRA_METHODS_IN_APPLICATIVE \
- $i > quickcheck-hugs/$i
+ "$src" > "$tgt"
done
echo "A Hugs-compatible version of QuickCheck is now"
diff --git a/Test/QuickCheck.hs b/src/Test/QuickCheck.hs
index e05268d..e05268d 100644
--- a/Test/QuickCheck.hs
+++ b/src/Test/QuickCheck.hs
diff --git a/Test/QuickCheck/All.hs b/src/Test/QuickCheck/All.hs
index 8230495..8230495 100644
--- a/Test/QuickCheck/All.hs
+++ b/src/Test/QuickCheck/All.hs
diff --git a/Test/QuickCheck/Arbitrary.hs b/src/Test/QuickCheck/Arbitrary.hs
index f3595d6..f3595d6 100644
--- a/Test/QuickCheck/Arbitrary.hs
+++ b/src/Test/QuickCheck/Arbitrary.hs
diff --git a/Test/QuickCheck/Exception.hs b/src/Test/QuickCheck/Exception.hs
index f8b34de..f8b34de 100644
--- a/Test/QuickCheck/Exception.hs
+++ b/src/Test/QuickCheck/Exception.hs
diff --git a/Test/QuickCheck/Features.hs b/src/Test/QuickCheck/Features.hs
index b2bbf5c..b2bbf5c 100644
--- a/Test/QuickCheck/Features.hs
+++ b/src/Test/QuickCheck/Features.hs
diff --git a/Test/QuickCheck/Function.hs b/src/Test/QuickCheck/Function.hs
index 11dc5d6..11dc5d6 100644
--- a/Test/QuickCheck/Function.hs
+++ b/src/Test/QuickCheck/Function.hs
diff --git a/Test/QuickCheck/Gen.hs b/src/Test/QuickCheck/Gen.hs
index 4648000..ee1507a 100644
--- a/Test/QuickCheck/Gen.hs
+++ b/src/Test/QuickCheck/Gen.hs
@@ -36,7 +36,7 @@ import Data.List
import Data.Ord
import Data.Maybe
#ifndef NO_SPLITMIX
-import System.Random.SplitMix(bitmaskWithRejection64', SMGen)
+import System.Random.SplitMix(bitmaskWithRejection64', SMGen, nextInteger)
#endif
import Data.Word
import Data.Int
@@ -194,7 +194,7 @@ chooseInteger (lo, hi)
| lo >= toInteger (minBound :: Word64) && lo <= toInteger (maxBound :: Word64) &&
hi >= toInteger (minBound :: Word64) && hi <= toInteger (maxBound :: Word64) =
fmap toInteger (chooseWord64 (fromInteger lo, fromInteger hi))
- | otherwise = choose (lo, hi)
+ | otherwise = MkGen $ \(QCGen g) _ -> fst (nextInteger lo hi g)
chooseWord64 :: (Word64, Word64) -> Gen Word64
chooseWord64 (lo, hi)
diff --git a/Test/QuickCheck/Gen/Unsafe.hs b/src/Test/QuickCheck/Gen/Unsafe.hs
index 514e8e9..514e8e9 100644
--- a/Test/QuickCheck/Gen/Unsafe.hs
+++ b/src/Test/QuickCheck/Gen/Unsafe.hs
diff --git a/Test/QuickCheck/Modifiers.hs b/src/Test/QuickCheck/Modifiers.hs
index 62f71c5..62f71c5 100644
--- a/Test/QuickCheck/Modifiers.hs
+++ b/src/Test/QuickCheck/Modifiers.hs
diff --git a/Test/QuickCheck/Monadic.hs b/src/Test/QuickCheck/Monadic.hs
index 1d1015e..1d1015e 100644
--- a/Test/QuickCheck/Monadic.hs
+++ b/src/Test/QuickCheck/Monadic.hs
diff --git a/Test/QuickCheck/Poly.hs b/src/Test/QuickCheck/Poly.hs
index 8044fdd..8044fdd 100644
--- a/Test/QuickCheck/Poly.hs
+++ b/src/Test/QuickCheck/Poly.hs
diff --git a/Test/QuickCheck/Property.hs b/src/Test/QuickCheck/Property.hs
index 4e0aae7..9c85328 100644
--- a/Test/QuickCheck/Property.hs
+++ b/src/Test/QuickCheck/Property.hs
@@ -420,8 +420,12 @@ whenFail' m =
then m
else return ()
--- | Prints out the generated testcase every time the property is tested.
+-- | Prints out the generated test case every time the property is tested.
-- Only variables quantified over /inside/ the 'verbose' are printed.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verbose :: Testable prop => prop -> Property
verbose = mapResult (\res -> res { callbacks = newCallback (callbacks res):callbacks res })
where newCallback cbs =
@@ -433,8 +437,12 @@ verbose = mapResult (\res -> res { callbacks = newCallback (callbacks res):callb
status MkResult{ok = Just False} = "Failed"
status MkResult{ok = Nothing} = "Skipped (precondition false)"
--- | Prints out the generated testcase every time the property fails, including during shrinking.
+-- | Prints out the generated test case every time the property fails, including during shrinking.
-- Only variables quantified over /inside/ the 'verboseShrinking' are printed.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verboseShrinking :: Testable prop => prop -> Property
verboseShrinking = mapResult (\res -> res { callbacks = newCallback (callbacks res):callbacks res })
where newCallback cbs =
diff --git a/Test/QuickCheck/Random.hs b/src/Test/QuickCheck/Random.hs
index aac4a09..64fd980 100644
--- a/Test/QuickCheck/Random.hs
+++ b/src/Test/QuickCheck/Random.hs
@@ -27,13 +27,39 @@ instance Read QCGen where
readsPrec n xs = [(QCGen g, ys) | (g, ys) <- readsPrec n xs]
instance RandomGen QCGen where
+#ifdef NO_SPLITMIX
split (QCGen g) =
case split g of
(g1, g2) -> (QCGen g1, QCGen g2)
genRange (QCGen g) = genRange g
- next (QCGen g) =
- case next g of
- (x, g') -> (x, QCGen g')
+ next = wrapQCGen next
+#else
+ split (QCGen g) =
+ case splitSMGen g of
+ (g1, g2) -> (QCGen g1, QCGen g2)
+ genRange _ = (minBound, maxBound)
+ next = wrapQCGen nextInt
+
+#ifndef OLD_RANDOM
+ genWord8 = wrapQCGen genWord8
+ genWord16 = wrapQCGen genWord16
+ genWord32 = wrapQCGen genWord32
+ genWord64 = wrapQCGen genWord64
+ genWord32R r = wrapQCGen (genWord32R r)
+ genWord64R r = wrapQCGen (genWord64R r)
+ genShortByteString n = wrapQCGen (genShortByteString n)
+#endif
+#endif
+
+{-# INLINE wrapQCGen #-}
+#ifdef NO_SPLITMIX
+wrapQCGen :: (StdGen -> (a, StdGen)) -> (QCGen -> (a, QCGen))
+#else
+wrapQCGen :: (SMGen -> (a, SMGen)) -> (QCGen -> (a, QCGen))
+#endif
+wrapQCGen f (QCGen g) =
+ case f g of
+ (x, g') -> (x, QCGen g')
newQCGen :: IO QCGen
#ifdef NO_SPLITMIX
diff --git a/Test/QuickCheck/State.hs b/src/Test/QuickCheck/State.hs
index ca8f179..ca8f179 100644
--- a/Test/QuickCheck/State.hs
+++ b/src/Test/QuickCheck/State.hs
diff --git a/Test/QuickCheck/Test.hs b/src/Test/QuickCheck/Test.hs
index 8dd6417..2cbcb08 100644
--- a/Test/QuickCheck/Test.hs
+++ b/src/Test/QuickCheck/Test.hs
@@ -237,21 +237,37 @@ withState a test = (if chatty a then withStdioTerminal else withNullTerminal) $
-- | Tests a property and prints the results and all test cases generated to 'stdout'.
-- This is just a convenience function that means the same as @'quickCheck' . 'verbose'@.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verboseCheck :: Testable prop => prop -> IO ()
verboseCheck p = quickCheck (verbose p)
-- | Tests a property, using test arguments, and prints the results and all test cases generated to 'stdout'.
-- This is just a convenience function that combines 'quickCheckWith' and 'verbose'.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verboseCheckWith :: Testable prop => Args -> prop -> IO ()
verboseCheckWith args p = quickCheckWith args (verbose p)
-- | Tests a property, produces a test result, and prints the results and all test cases generated to 'stdout'.
-- This is just a convenience function that combines 'quickCheckResult' and 'verbose'.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verboseCheckResult :: Testable prop => prop -> IO Result
verboseCheckResult p = quickCheckResult (verbose p)
-- | Tests a property, using test arguments, produces a test result, and prints the results and all test cases generated to 'stdout'.
-- This is just a convenience function that combines 'quickCheckWithResult' and 'verbose'.
+--
+-- Note: for technical reasons, the test case is printed out /after/
+-- the property is tested. To debug a property that goes into an
+-- infinite loop, use 'within' to add a timeout instead.
verboseCheckWithResult :: Testable prop => Args -> prop -> IO Result
verboseCheckWithResult a p = quickCheckWithResult a (verbose p)
diff --git a/Test/QuickCheck/Text.hs b/src/Test/QuickCheck/Text.hs
index 115cfa9..115cfa9 100644
--- a/Test/QuickCheck/Text.hs
+++ b/src/Test/QuickCheck/Text.hs
diff --git a/test-hugs b/test-hugs
new file mode 100755
index 0000000..81dd456
--- /dev/null
+++ b/test-hugs
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+CABAL=${CABAL:-cabal}
+HC=${HC:-ghc}
+
+# Install cpphs if it is not in path
+command -v cpphs || ${CABAL} v2-install --ignore-project --with-compiler "$HC" cpphs
+
+# Regenerate quickcheck-hugs
+sh make-hugs
+find quickcheck-hugs
+
+die() {
+ echo "TEST FAILED"
+ exit 1
+}
+
+dotest() {
+ echo "$2" | hugs -98 -Pquickcheck-hugs: -p'> ' "$1" | tee hugs.output
+ grep "$3" hugs.output || die
+}
+
+# Simple tests
+dotest Test.QuickCheck 'quickCheck $ \xs -> reverse (reverse xs) === (xs :: [Int])' "OK, passed 100 tests."
diff --git a/tests/GCoArbitraryExample.hs b/tests/GCoArbitraryExample.hs
index e5c0da8..1da1157 100644
--- a/tests/GCoArbitraryExample.hs
+++ b/tests/GCoArbitraryExample.hs
@@ -9,7 +9,7 @@ import Test.QuickCheck.Function
data D a = C1 a | C2 deriving (Eq, Show, Read, Generic)
-instance Arbitrary a => Arbitrary (D a)
+instance Arbitrary a => Arbitrary (D a) where arbitrary = error "not implemented"
instance CoArbitrary a => CoArbitrary (D a)
instance (Show a, Read a) => Function (D a) where
diff --git a/tests/GShrinkExample.hs b/tests/GShrinkExample.hs
index 4fa4dc7..3d7be92 100644
--- a/tests/GShrinkExample.hs
+++ b/tests/GShrinkExample.hs
@@ -8,7 +8,7 @@ import Test.QuickCheck
data Nat = Z | S Nat deriving (Eq, Show, Generic)
-instance Arbitrary Nat
+instance Arbitrary Nat where arbitrary = error "not implemented"
prop_shrink =
genericShrink (S (S Z)) === [S Z] .&&.