gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / ghc-monad-par-fix-tests.patch
1 This patch is taken from upstream. It fixes a test to work with GHC 8.6.
2 The paths have been slightly altered to work with the release tarball.
3
4 See <https://github.com/simonmar/monad-par/issues/66>.
5
6 From e20f81c8060208e4fb038e8f0e0668b41d72a6fb Mon Sep 17 00:00:00 2001
7 From: Clint Adams <clint@debian.org>
8 Date: Sat, 31 Aug 2019 14:12:34 -0400
9 Subject: [PATCH] Use a case statement instead of pattern-matching in
10 case_test_diamond
11
12 This avoids the need for a MonadFail instance. Closes #66
13 ---
14 monad-par/tests/ParTests_shared.hs | 15 +++++++++------
15 1 file changed, 9 insertions(+), 6 deletions(-)
16
17 diff --git a/tests/ParTests_shared.hs b/tests/ParTests_shared.hs
18 index 31f438d..b2de50c 100644
19 --- a/tests/ParTests_shared.hs
20 +++ b/tests/ParTests_shared.hs
21 @@ -109,12 +109,15 @@ case_test_diamond :: Assertion
22 case_test_diamond = 9 @=? (m :: Int)
23 where
24 m = runPar $ do
25 - [a,b,c,d] <- sequence [new,new,new,new]
26 - fork $ do x <- get a; put b (x+1)
27 - fork $ do x <- get a; put c (x+2)
28 - fork $ do x <- get b; y <- get c; put d (x+y)
29 - fork $ do put a 3
30 - get d
31 + abcd <- sequence [new,new,new,new]
32 + case abcd of
33 + [a,b,c,d] -> do
34 + fork $ do x <- get a; put b (x+1)
35 + fork $ do x <- get a; put c (x+2)
36 + fork $ do x <- get b; y <- get c; put d (x+y)
37 + fork $ do put a 3
38 + get d
39 + _ -> error "Oops"
40
41 -- | Violate IVar single-assignment:
42 --
43 --
44 2.23.0
45