Skip to content

Commit d36cb02

Browse files
committed
Support latest exceptions package.
Introduce an implementation for generalizedBracket call.
1 parent 347b2e4 commit d36cb02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

distributed-process.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Library
5454
distributed-static >= 0.2 && < 0.4,
5555
rank1dynamic >= 0.1 && < 0.5,
5656
syb >= 0.3 && < 0.8,
57-
exceptions >= 0.5,
57+
exceptions >= 0.10,
5858
containers >= 0.5 && < 0.6,
5959
deepseq >= 1.3.0.1 && < 1.6
6060
Exposed-modules: Control.Distributed.Process,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,12 @@ instance MonadCatch Process where
366366
lproc <- ask
367367
liftIO $ catch (runLocalProcess lproc p) (runLocalProcess lproc . h)
368368
instance MonadMask Process where
369+
generalBracket acquire release inner = do
370+
lproc <- ask
371+
liftIO $
372+
generalBracket (runLocalProcess lproc acquire)
373+
(\a e -> runLocalProcess lproc $ release a e)
374+
(runLocalProcess lproc . inner)
369375
mask p = do
370376
lproc <- ask
371377
liftIO $ mask $ \restore ->

0 commit comments

Comments
 (0)