Skip to content
Snippets Groups Projects
Commit 0fe26b96 authored by Jens Nolte's avatar Jens Nolte
Browse files

Add askResourceManager documentation

parent 5b287e01
No related branches found
No related tags found
No related merge requests found
...@@ -232,11 +232,12 @@ class (MonadAwait m, MonadMask m, MonadIO m) => MonadResourceManager m where ...@@ -232,11 +232,12 @@ class (MonadAwait m, MonadMask m, MonadIO m) => MonadResourceManager m where
localResourceManager :: ResourceManager -> m a -> m a localResourceManager :: ResourceManager -> m a -> m a
-- | Get the underlying resource manager. This is intended to fork the Monad (e.g. in the `async`-Function) and must
-- not be used to dispose the resource manager (also doing so is a deadlock).
--
-- Might be replaced with an alternative mechanism in the future.
askResourceManager :: m ResourceManager askResourceManager :: m ResourceManager
-- TODO askResourceManager could maybe be replaced with
--withRunResourceContextInIO :: (((forall f. MonadResourceManager f => f a) -> IO a) -> m b) -> m b
instance (MonadAwait m, MonadMask m, MonadIO m) => MonadResourceManager (ReaderT ResourceManager m) where instance (MonadAwait m, MonadMask m, MonadIO m) => MonadResourceManager (ReaderT ResourceManager m) where
registerDisposable disposable = do registerDisposable disposable = do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment