@@ -22,8 +22,11 @@ module Asyncly.AsyncT
22 , MonadAsync
22 , MonadAsync
23 , runAsyncly
23 , runAsyncly
27 , zipWithM
30 , zipWithM
29 , ZipSerial (..)
32 , ZipSerial (..)
@@ -768,6 +771,9 @@ pushOneToCtx ctype m = do
768 pushWorker ctx
771 pushWorker ctx
769 return ctx
772 return ctx
774+-- | Run a computation asynchronously, triggers the computation and returns
775+-- another computation (i.e. a promise) that when run produces the output from
776+-- the original computation.
771async :: MonadAsync m => AsyncT m a -> m (AsyncT m a)
777async :: MonadAsync m => AsyncT m a -> m (AsyncT m a)
772async m = do
778async m = do
773 ctx <- pushOneToCtx (CtxType Disjunction LIFO) m
779 ctx <- pushOneToCtx (CtxType Disjunction LIFO) m