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

Fix warnings

parent 0fe26b96
No related branches found
No related tags found
No related merge requests found
......@@ -34,16 +34,16 @@ class (MonadAwait m, MonadResourceManager m) => MonadAsync m where
instance MonadAsync m => MonadAsync (ReaderT r m) where
asyncWithUnmask :: MonadAsync m => ((forall b. ReaderT r m b -> ReaderT r m b) -> ReaderT r m a) -> ReaderT r m (Awaitable a)
asyncWithUnmask :: ((forall b. ReaderT r m b -> ReaderT r m b) -> ReaderT r m a) -> ReaderT r m (Awaitable a)
asyncWithUnmask action = do
x <- ask
lift $ asyncWithUnmask \unmask -> runReaderT (action (liftUnmask unmask)) x
where
-- | Lift an "unmask" action (e.g. from `mask`) into a `ReaderT`.
liftUnmask :: (m a -> m a) -> (ReaderT r m) a -> (ReaderT r m) a
liftUnmask unmask action = do
liftUnmask unmask innerAction = do
value <- ask
lift $ unmask $ runReaderT action value
lift $ unmask $ runReaderT innerAction value
async_ :: MonadAsync m => m () -> m ()
......@@ -79,9 +79,9 @@ instance MonadAsync UnlimitedAsync where
pure $ toAwaitable task
where
liftUnmask :: (forall b. IO b -> IO b) -> UnlimitedAsync a -> UnlimitedAsync a
liftUnmask unmask (UnlimitedAsync action) = UnlimitedAsync do
liftUnmask unmask (UnlimitedAsync innerAction) = UnlimitedAsync do
resourceManager <- ask
liftIO $ unmask $ runReaderT action resourceManager
liftIO $ unmask $ runReaderT innerAction resourceManager
-- | Run a computation in `MonadAsync` where `async` is implemented without any thread limits (i.e. every `async` will
......
......@@ -462,7 +462,7 @@ synchronousFnObservable
-> Observable v
synchronousFnObservable observeFn synchronousRetrieveFn = fnObservable observeFn retrieveFn
where
retrieveFn :: (forall m. (MonadResourceManager m, MonadAwait m) => m (Awaitable v))
retrieveFn :: (forall m. MonadResourceManager m => m (Awaitable v))
retrieveFn = liftIO $ pure <$> synchronousRetrieveFn
......
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