Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
exnFinally :: forall e m a . MonadTunnelIO m => Exn m e -> m a -> m () -> m amonadology Control.Monad.Ology.Data.Exn No documentation available.
forkFinally :: IO a -> IO b -> IO ThreadIdslave-thread SlaveThread Fork a slave thread with a finalizer action to run a computation on. The finalizer gets executed when the thread dies for whatever reason: due to being killed or an uncaught exception, or a normal termination. Note the order of arguments:
forkFinally finalizer computation
forkFinallyWithUnmask :: IO a -> ((forall x . () => IO x -> IO x) -> IO b) -> IO ThreadIdslave-thread SlaveThread Like forkFinally, but provides the computation a function that unmasks asynchronous exceptions. See Note [Unmask] at the bottom of this module.
forkFinally :: Unexceptional m => UIO a -> (Either PseudoException a -> UIO ()) -> m ThreadIdunexceptionalio UnexceptionalIO Mirrors forkFinally, but since the body is UIO, the thread must terminate successfully or because of PseudoException
forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadIdforkable-monad Control.Concurrent.Forkable Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.
forkFinally action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
This function is useful for informing the parent when a child terminates, for example.forkFinally :: Unexceptional m => UIO a -> (Either PseudoException a -> UIO ()) -> m ThreadIdunexceptionalio-trans UnexceptionalIO.Trans Mirrors forkFinally, but since the body is UIO, the thread must terminate successfully or because of PseudoException
forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadIdverset Verset Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.
forkFinally action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
This function is useful for informing the parent when a child terminates, for example.