git.iko.soy/distributed-process
on master help sign in
Support latest exceptions package.

Introduce an implementation for generalizedBracket call.

commitd36cb0289043839590691aa1078d2dd02a73d83a authorAlexander Vershilov <alexander.vershilov@gmail.com> dateSat 28 Apr 2018, 21:46 (8 years ago) parent347b2e4
2 files changed+7−1
distributed-process.cabal+1−1 src/Control/Distributed/Process/Internal/Types.hs+6
distributed-process.cabal+1−1
@@ -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+6
@@ -366,6 +366,12 @@ instance MonadCatch Process where
366366 lproc <- ask
367367 liftIO $ catch (runLocalProcess lproc p) (runLocalProcess lproc . h)
368368instance 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 ->