summary refs log tree commit diff
path: root/gnu/packages/patches/ghc-monad-par-fix-tests.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-11-21 22:44:15 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-11-21 22:44:15 +0100
commitb60d2bfff95c0859d7814c1fe9d0940c87edc2b4 (patch)
tree49d3339f93c9d9fad5c66609a1dc4964f2856f79 /gnu/packages/patches/ghc-monad-par-fix-tests.patch
parent0c6ab52243353e3417e5a9733bb089e4771cc86e (diff)
parenta31b9dac1cbda07225fcdffe03d13d68c4eab981 (diff)
downloadguix-b60d2bfff95c0859d7814c1fe9d0940c87edc2b4.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches/ghc-monad-par-fix-tests.patch')
-rw-r--r--gnu/packages/patches/ghc-monad-par-fix-tests.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/patches/ghc-monad-par-fix-tests.patch b/gnu/packages/patches/ghc-monad-par-fix-tests.patch
new file mode 100644
index 0000000000..d21a1e485c
--- /dev/null
+++ b/gnu/packages/patches/ghc-monad-par-fix-tests.patch
@@ -0,0 +1,45 @@
+This patch is taken from upstream.  It fixes a test to work with GHC 8.6.
+The paths have been slightly altered to work with the release tarball.
+
+See <https://github.com/simonmar/monad-par/issues/66>.
+
+From e20f81c8060208e4fb038e8f0e0668b41d72a6fb Mon Sep 17 00:00:00 2001
+From: Clint Adams <clint@debian.org>
+Date: Sat, 31 Aug 2019 14:12:34 -0400
+Subject: [PATCH] Use a case statement instead of pattern-matching in
+ case_test_diamond
+
+This avoids the need for a MonadFail instance.  Closes #66
+---
+ monad-par/tests/ParTests_shared.hs | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/tests/ParTests_shared.hs b/tests/ParTests_shared.hs
+index 31f438d..b2de50c 100644
+--- a/tests/ParTests_shared.hs
++++ b/tests/ParTests_shared.hs
+@@ -109,12 +109,15 @@ case_test_diamond :: Assertion
+ case_test_diamond = 9 @=? (m :: Int)
+  where 
+   m = runPar $ do
+-      [a,b,c,d] <- sequence [new,new,new,new]
+-      fork $ do x <- get a; put b (x+1)
+-      fork $ do x <- get a; put c (x+2)
+-      fork $ do x <- get b; y <- get c; put d (x+y)
+-      fork $ do put a 3
+-      get d
++      abcd <- sequence [new,new,new,new]
++      case abcd of
++          [a,b,c,d] -> do
++              fork $ do x <- get a; put b (x+1)
++              fork $ do x <- get a; put c (x+2)
++              fork $ do x <- get b; y <- get c; put d (x+y)
++              fork $ do put a 3
++              get d
++          _ -> error "Oops"
+ 
+ -- | Violate IVar single-assignment:
+ --
+-- 
+2.23.0
+