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

Move `await` implementation for IO to class definition

parent 9146fce8
No related branches found
No related tags found
No related merge requests found
Pipeline #2409 passed
......@@ -76,7 +76,7 @@ class Monad m => MonadAwait m where
await :: IsAwaitable r a => a -> m r
instance MonadAwait IO where
await = awaitIO
await awaitable = liftIO $ runQueryT atomically (runAwaitable awaitable)
instance MonadAwait m => MonadAwait (ReaderT a m) where
await = lift . await
......@@ -86,9 +86,6 @@ awaitResult :: (IsAwaitable r a, MonadAwait m) => m a -> m r
awaitResult = (await =<<)
awaitIO :: (IsAwaitable r a, MonadIO m) => a -> m r
awaitIO awaitable = liftIO $ runQueryT atomically (runAwaitable awaitable)
peekAwaitable :: (IsAwaitable r a, MonadIO m) => a -> m (Maybe (Either SomeException r))
peekAwaitable awaitable = liftIO $ runMaybeT $ try $ runQueryT queryFn (runAwaitable awaitable)
where
......
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