summaryrefslogtreecommitdiff
path: root/standalone/android/haskell-patches/resourcet_0.4.4_0001-hack-to-build-with-hacked-up-lifted-base-which-is-cu.patch
blob: bcf3439fac80a797e0b92b09be5fb8ba8cdce99f (plain)
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
36
37
38
39
40
41
42
43
44
From c10ab80793a21dce0c7516725e1ca3b36a87aa25 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:35:08 -0400
Subject: [PATCH] hack to build with hacked up lifted-base, which is currently
 lacking a mask

---
 Control/Monad/Trans/Resource.hs |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Control/Monad/Trans/Resource.hs b/Control/Monad/Trans/Resource.hs
index d209dd8..61ab349 100644
--- a/Control/Monad/Trans/Resource.hs
+++ b/Control/Monad/Trans/Resource.hs
@@ -5,7 +5,7 @@
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable, ImpredicativeTypes #-}
 #if __GLASGOW_HASKELL__ >= 704
 {-# LANGUAGE ConstraintKinds #-}
 #endif
@@ -554,7 +554,7 @@ GOX(Monoid w, Strict.WriterT w)
 --
 -- Since 0.3.0
 resourceForkIO :: MonadBaseControl IO m => ResourceT m () -> ResourceT m ThreadId
-resourceForkIO (ResourceT f) = ResourceT $ \r -> L.mask $ \restore ->
+resourceForkIO (ResourceT f) = ResourceT $ \r ->
     -- We need to make sure the counter is incremented before this call
     -- returns. Otherwise, the parent thread may call runResourceT before
     -- the child thread increments, and all resources will be freed
@@ -565,7 +565,7 @@ resourceForkIO (ResourceT f) = ResourceT $ \r -> L.mask $ \restore ->
         (liftBaseDiscard forkIO $ bracket_
             (return ())
             (stateCleanup r)
-            (restore $ f r))
+            (return ()))
 
 -- | A @Monad@ based on some monad which allows running of some 'IO' actions,
 -- via unsafe calls. This applies to 'IO' and 'ST', for instance.
-- 
1.7.10.4