From f3382596498a69d8ebce1e0ccb36dd99e9ae3810 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 19 Nov 2020 07:44:53 +0800 Subject: [PATCH] Fix compatibility with QuickCheck 2.14.2 (#266) Fixes #265 --- test/Algebra/Graph/Test/Arbitrary.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Algebra/Graph/Test/Arbitrary.hs b/test/Algebra/Graph/Test/Arbitrary.hs index 9ba072b8..1f67715a 100644 --- a/test/Algebra/Graph/Test/Arbitrary.hs +++ b/test/Algebra/Graph/Test/Arbitrary.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | @@ -217,6 +218,7 @@ instance (Arbitrary a, Arbitrary e, Monoid e) => Arbitrary (LG.Graph e a) where shrink (LG.Connect e x y) = [LG.Empty, x, y, LG.Connect mempty x y] ++ [LG.Connect e x' y' | (x', y') <- shrink (x, y) ] +#if !MIN_VERSION_QuickCheck(2,14,2) instance Arbitrary a => Arbitrary (Tree a) where arbitrary = sized go where @@ -231,6 +233,7 @@ instance Arbitrary a => Arbitrary (Tree a) where return $ Node root children shrink (Node r fs) = [Node r fs' | fs' <- shrink fs] +#endif -- TODO: Implement a custom shrink method. instance Arbitrary s => Arbitrary (Doc s) where