Skip to content

Commit d91a88f

Browse files
Merge pull request #316 from haskell-distributed/gh-315
Support latest exceptions package.
2 parents 347b2e4 + df911bf commit d91a88f

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[Unreliazed]
2+
3+
# Added
4+
* Added support for exceptions >= 0.10
5+
16
2017-08-31 Facundo Domínguez <facundo.dominguez@tweag.io> 0.7.3
27

38
* Drop support for ghc-7.8.* and earlier.

src/Control/Distributed/Process/Internal/Types.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ instance MonadCatch Process where
366366
lproc <- ask
367367
liftIO $ catch (runLocalProcess lproc p) (runLocalProcess lproc . h)
368368
instance MonadMask Process where
369+
#if MIN_VERSION_exceptions(0,10,0)
370+
generalBracket acquire release inner = do
371+
lproc <- ask
372+
liftIO $
373+
generalBracket (runLocalProcess lproc acquire)
374+
(\a e -> runLocalProcess lproc $ release a e)
375+
(runLocalProcess lproc . inner)
376+
#endif
369377
mask p = do
370378
lproc <- ask
371379
liftIO $ mask $ \restore ->

src/Control/Distributed/Process/Management/Internal/Trace/Types.hs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import Control.Distributed.Process.Serializable
4343
import Data.Binary
4444
import Data.List (intersperse)
4545
import Data.Set (Set)
46-
import qualified Data.Set as Set (fromList)
4746
import Data.Typeable
4847
import GHC.Generics
4948

@@ -158,12 +157,3 @@ getTraceFlags t s = publishEvent t (unsafeCreateUnencodedMessage s)
158157

159158
getCurrentTraceClient :: MxEventBus -> SendPort (Maybe ProcessId) -> IO ()
160159
getCurrentTraceClient t s = publishEvent t (unsafeCreateUnencodedMessage s)
161-
162-
class Traceable a where
163-
uod :: [a] -> TraceSubject
164-
165-
instance Traceable ProcessId where
166-
uod = TraceProcs . Set.fromList
167-
168-
instance Traceable String where
169-
uod = TraceNames . Set.fromList

src/Control/Distributed/Process/Node.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import qualified Data.Map as Map
3737
, filterWithKey
3838
, foldlWithKey
3939
)
40-
import qualified Data.Set as Set
4140
import Data.Time.Format (formatTime)
4241
#if MIN_VERSION_time(1,5,0)
4342
import Data.Time.Format (defaultTimeLocale)
@@ -55,7 +54,6 @@ import qualified Data.Set as Set
5554
, union
5655
)
5756
import Data.Foldable (forM_)
58-
import Data.List (foldl')
5957
import Data.Maybe (isJust, fromJust, isNothing, catMaybes)
6058
import Data.Typeable (Typeable)
6159
import Control.Category ((>>>))

0 commit comments

Comments
 (0)