Export the async API

This commit is contained in:
Harendra Kumar 2017-10-14 21:32:37 +05:30
parent 50e16043f8
commit e75a12d4fa
2 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,7 @@ module Asyncly
-- * Running
, runAsyncly
, toList
, async
-- * Monadic Composition (Conjunction)
-- $bind

View File

@ -22,8 +22,11 @@ module Asyncly.AsyncT
, MonadAsync
, runAsyncly
, toList
, async
, take
, drop
, zipWithM
, zipWith
, ZipSerial (..)
@ -768,6 +771,9 @@ pushOneToCtx ctype m = do
pushWorker ctx
return ctx
-- | Run a computation asynchronously, triggers the computation and returns
-- another computation (i.e. a promise) that when run produces the output from
-- the original computation.
async :: MonadAsync m => AsyncT m a -> m (AsyncT m a)
async m = do
ctx <- pushOneToCtx (CtxType Disjunction LIFO) m