algebraic-graphs-0.5-upstream-fix-duplicate-arbitrary-instance.patch 1.31 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From f3382596498a69d8ebce1e0ccb36dd99e9ae3810 Mon Sep 17 00:00:00 2001
From: Felix Yan <felixonmars@archlinux.org>
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