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

Sort export lists

parent 83377f66
No related branches found
No related tags found
No related merge requests found
module Quasar.Awaitable ( module Quasar.Awaitable (
-- * Awaitable -- * MonadAwaitable
MonadAwait(..), MonadAwait(..),
IsAwaitable(..),
Awaitable,
awaitResult, awaitResult,
peekAwaitable, peekAwaitable,
-- * Awaitable
IsAwaitable(..),
Awaitable,
successfulAwaitable, successfulAwaitable,
failedAwaitable, failedAwaitable,
completedAwaitable, completedAwaitable,
...@@ -58,20 +60,6 @@ import Data.Sequence ...@@ -58,20 +60,6 @@ import Data.Sequence
import Quasar.Prelude import Quasar.Prelude
class IsAwaitable r a | a -> r where
runAwaitable :: (MonadQuerySTM m) => a -> m r
runAwaitable self = runAwaitable (toAwaitable self)
cacheAwaitable :: MonadIO m => a -> m (Awaitable r)
cacheAwaitable self = cacheAwaitable (toAwaitable self)
toAwaitable :: a -> Awaitable r
toAwaitable = Awaitable
{-# MINIMAL toAwaitable | (runAwaitable, cacheAwaitable) #-}
class (MonadCatch m, MonadPlus m) => MonadAwait m where class (MonadCatch m, MonadPlus m) => MonadAwait m where
await :: IsAwaitable r a => a -> m r await :: IsAwaitable r a => a -> m r
...@@ -95,6 +83,20 @@ peekAwaitable awaitable = liftIO $ runMaybeT $ runQueryT queryFn (runAwaitable a ...@@ -95,6 +83,20 @@ peekAwaitable awaitable = liftIO $ runMaybeT $ runQueryT queryFn (runAwaitable a
queryFn transaction = MaybeT $ atomically $ (Just <$> transaction) `orElse` pure Nothing queryFn transaction = MaybeT $ atomically $ (Just <$> transaction) `orElse` pure Nothing
class IsAwaitable r a | a -> r where
runAwaitable :: (MonadQuerySTM m) => a -> m r
runAwaitable self = runAwaitable (toAwaitable self)
cacheAwaitable :: MonadIO m => a -> m (Awaitable r)
cacheAwaitable self = cacheAwaitable (toAwaitable self)
toAwaitable :: a -> Awaitable r
toAwaitable = Awaitable
{-# MINIMAL toAwaitable | (runAwaitable, cacheAwaitable) #-}
data Awaitable r = forall a. IsAwaitable r a => Awaitable a data Awaitable r = forall a. IsAwaitable r a => Awaitable a
instance IsAwaitable r (Awaitable r) where instance IsAwaitable r (Awaitable r) where
......
...@@ -8,19 +8,21 @@ module Quasar.Disposable ( ...@@ -8,19 +8,21 @@ module Quasar.Disposable (
noDisposable, noDisposable,
alreadyDisposing, alreadyDisposing,
-- * MonadResourceManager
MonadResourceManager(..),
disposeEventually,
withOnResourceManager,
onResourceManager,
-- ** ResourceManager -- ** ResourceManager
ResourceManager,
IsResourceManager(..), IsResourceManager(..),
MonadResourceManager(..), ResourceManager,
withResourceManager, withResourceManager,
withOnResourceManager,
newResourceManager, newResourceManager,
unsafeNewResourceManager, unsafeNewResourceManager,
onResourceManager,
attachDisposable, attachDisposable,
attachDisposeAction, attachDisposeAction,
attachDisposeAction_, attachDisposeAction_,
disposeEventually,
-- * Task -- * Task
Task(..), Task(..),
......
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