Îõ³h&1¾/ªÞ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\](c) Simon Marlow 2012BSD3 (see the file LICENSE)!Simon Marlow  provisional#non-portable (requires concurrency) TrustworthyÉÊ×Ü-â>asyncA value of type ConcurrentlyE e a is an IO, operation that can be composed with other  ConcurrentlyE values, using the  Applicative instance.Calling runConcurrentlyE on a value of type ConcurrentlyE e a will execute the IOÓ operations it contains concurrently, before delivering either the result of type a, or an error of type e if one of the actions returns Left.| @since 2.2.5asyncA value of type Concurrently a is an IO, operation that can be composed with other  Concurrently values, using the  Applicative and  Alternative instances.Calling runConcurrently on a value of type Concurrently a will execute the IOÌ operations it contains concurrently, before delivering the result of type a. For example ¢(page1, page2, page3) <- runConcurrently $ (,,) <$> Concurrently (getURL "url1") <*> Concurrently (getURL "url2") <*> Concurrently (getURL "url3")asyncThe exception thrown by ! to terminate a thread. async"An asynchronous action spawned by  or °. Asynchronous actions are executed in a separate thread, and operations are provided for waiting for asynchronous actions to complete and obtaining their results (see e.g. ). async Returns the ^" of the thread running the given  .async:Compare two Asyncs that may have different types by their ^.async2Spawn an asynchronous action in a separate thread. Like for _ß, the action may be left running unintentionally (see module-level documentation for details).Use * style functions wherever you can instead!asyncLike  but using ` internally.asyncLike  but using a internally.asyncLike  but using bé internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.asyncLike  but using cé internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.asyncÁSpawn an asynchronous action in a separate thread, and pass its AsyncÖ handle to the supplied function. When the function returns or throws an exception, # is called on the Async. ‚withAsync action inner = mask $ \restore -> do a <- async (restore action) restore (inner a) `finally` uninterruptibleCancel aThis is a useful variant of  that ensures an Async( is never left running unintentionally.ÇNote: a reference to the child thread is kept alive until the call to  returns, so nesting many  calls requires linear memory.asyncLike  but uses ` internally.asyncLike  but uses a internally.asyncLike  but uses bé internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.asyncLike  but uses cè internally. The child thread is passed a function that can be used to unmask asynchronous exceptionsasync˜Wait for an asynchronous action to complete, and return its value. If the asynchronous action threw an exception, then the exception is re-thrown by . wait = atomically . waitSTMasyncÀWait for an asynchronous action to complete, and return either Left e# if the action raised an exception e, or Right a if it returned a value a. %waitCatch = atomically . waitCatchSTMasyncCheck whether an  Æ has completed yet. If it has not completed yet, then the result is Nothing, otherwise the result is Just e where e is Left x if the Async raised an exception x, or Right a if it returned a value a. poll = atomically . pollSTMasync A version of , that can be used inside an STM transaction.async A version of , that can be used inside an STM transaction. async A version of , that can be used inside an STM transaction.!async.Cancel an asynchronous action by throwing the AsyncCancelled' exception to it, and waiting for the  ' thread to quit. Has no effect if the   has already completed. Âcancel a = throwTo (asyncThreadId a) AsyncCancelled <* waitCatch a Note that !) will not terminate until the thread the  , refers to has terminated. This means that !Õ will block for as long said thread blocks when receiving an asynchronous exception.For example, it could block if:ÓIt's executing a foreign call, and thus cannot receive the asynchronous exception;æIt's executing some cleanup handler after having received the exception, and the handler is blocking."async5Cancel multiple asynchronous actions by throwing the AsyncCancelled> exception to each of them in turn, then waiting for all the   threads to complete.#asyncCancel an asynchronous actionThis is a variant of !, but it is not interruptible.$asyncÈCancel an asynchronous action by throwing the supplied exception to it. ,cancelWith a x = throwTo (asyncThreadId a) x*The notes about the synchronous nature of ! also apply to $.%asyncçWait for any of the supplied asynchronous operations to complete. The value returned is a pair of the  ; that completed, and the result that would be returned by  on that  $. The input list must be non-empty. If multiple  Ús complete or have completed, then the value returned corresponds to the first completed   in the list.&async A version of %, that can be used inside an STM transaction.'asyncLike %Ó, but also cancels the other asynchronous operations as soon as one has completed.(asyncWait for any of the supplied Asyncäs to complete. If the first to complete throws an exception, then that exception is re-thrown by ($. The input list must be non-empty. If multiple  Ús complete or have completed, then the value returned corresponds to the first completed   in the list.)async A version of (, that can be used inside an STM transaction.*asyncLike (Ó, but also cancels the other asynchronous operations as soon as one has completed.+asyncWait for the first of two Async s to finish.,async A version of +, that can be used inside an STM transaction.-asyncLike + , but also !s both Asyncs before returning..asyncWait for the first of two Asyncs to finish. If the AsyncÏ that finished first raised an exception, then the exception is re-thrown by ../async A version of ., that can be used inside an STM transaction.0asyncLike ., but the result is ignored.1async A version of 0, that can be used inside an STM transaction.2asyncLike . , but also !s both Asyncs before returning.3asyncWaits for both Asyncüs to finish, but if either of them throws an exception before they have both finished, then the exception is re-thrown by 3.4async A version of 3, that can be used inside an STM transaction.5asyncLink the given Async* to the current thread, such that if the AsyncÚ raises an exception, that exception will be re-thrown in the current thread, wrapped in .5 ignores > exceptions thrown in the other thread, so that it's safe to !à a thread you're linked to. If you want different behaviour, use 6.6asyncLink the given Async* to the current thread, such that if the AsyncÚ raises an exception, that exception will be re-thrown in the current thread, wrapped in .óThe supplied predicate determines which exceptions in the target thread should be propagated to the source thread.7async Link two Asyncãs together, such that if either raises an exception, the same exception is re-thrown in the other Async, wrapped in .7 ignores ' exceptions, so that it's possible to !Ô either thread without cancelling the other. If you want different behaviour, use 8.8async Link two Asyncãs together, such that if either raises an exception, the same exception is re-thrown in the other Async, wrapped in .óThe supplied predicate determines which exceptions in the target thread should be propagated to the source thread.:asyncRun two IOÒ actions concurrently, and return the first to finish. The loser of the race is !led. Õrace left right = withAsync left $ \a -> withAsync right $ \b -> waitEither a b;asyncLike :, but the result is ignored.<asyncRun two IOþ actions concurrently, and return both results. If either action throws an exception at any time, then the other action is !(led, and the exception is re-thrown by <. Ûconcurrently left right = withAsync left $ \a -> withAsync right $ \b -> waitBoth a b=asyncRun two IO0 actions concurrently. If both of them end with Right2, return both results. If one of then ends with Left-, interrupt the other action and return the Left. ?async<, but ignore the result values@asyncMaps an d-performing function over any e data type, performing all the IOî actions concurrently, and returning the original data structure with the arguments replaced by the results.ïIf any of the actions throw an exception, then all other actions are cancelled and the exception is re-thrown. For example, mapConcurrently works with lists: 8pages <- mapConcurrently getURL ["url1", "url2", "url3"]Take into account that asyncÁ will try to immediately spawn a thread for each element of the  Traversable‹, so running this on large inputs without care may lead to resource exhaustion (of memory, file descriptors, or other limited resources).AasyncA is @ with its arguments flipped Æpages <- forConcurrently ["url1", "url2", "url3"] $ \url -> getURL urlBasyncB is @> with the return value discarded; a concurrent equivalent of f.CasyncC is A> with the return value discarded; a concurrent equivalent of g.Dasync2Perform the action in the given number of threads.EasyncSame as D, but ignore the results.Fasync¾Fork a thread that runs the supplied action, and if it raises an exception, re-runs the action. The thread terminates only when the action runs to completion without raising an exception.RasyncSasyncOnly defined by async for  base >= 4.9Tasync waits forever. ! returns the first to finish and ! s the other.XasyncÈEither the combination of the successful results, or the first failure. 6asyncreturn h) if the exception should be propagated, i otherwise.Ë  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJË  !" #$%&'()*+,-./0123456789:;<=?>@ABCDEFGHIJ(c) Simon Marlow 2012BSD3 (see the file LICENSE)!Simon Marlow  provisional#non-portable (requires concurrency) Safe-Inferred/$À  !"#$%&'()*+,-./012345678:;<=?@ABCDEÀ  !"#$ :;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a_`b_cd_`e_`f_`ghij_kl_mn_mohiphiqò"async-2.2.5-9Xp4PinOoKOIXUiv0pxks3!Control.Concurrent.Async.InternalControl.Alternativeempty<|>Control.Concurrent.Async ConcurrentlyErunConcurrentlyE ConcurrentlyrunConcurrentlyExceptionInLinkedThreadAsyncCancelledAsync asyncThreadId _asyncWait compareAsyncsasync asyncBoundasyncOnasyncWithUnmaskasyncOnWithUnmask asyncUsing withAsyncwithAsyncBound withAsyncOnwithAsyncWithUnmaskwithAsyncOnWithUnmaskwithAsyncUsingwait waitCatchpollwaitSTM waitCatchSTMpollSTMcancel cancelManyuninterruptibleCancel cancelWith waitAnyCatchwaitAnyCatchSTMwaitAnyCatchCancelwaitAny waitAnySTM waitAnyCancelwaitEitherCatchwaitEitherCatchSTMwaitEitherCatchCancel waitEither waitEitherSTM waitEither_waitEitherSTM_waitEitherCancelwaitBoth waitBothSTMlinklinkOnlylink2 link2OnlyisCancelracerace_ concurrently concurrentlyE concurrently' concurrently_mapConcurrentlyforConcurrentlymapConcurrently_forConcurrently_replicateConcurrentlyreplicateConcurrently_ forkRepeatcatchAlltryAll rawForkIO rawForkOn$fFunctorAsync$fHashableAsync $fOrdAsync $fEqAsync$fExceptionAsyncCancelled"$fExceptionExceptionInLinkedThread$fShowExceptionInLinkedThread$fMonoidConcurrently$fSemigroupConcurrently$fAlternativeConcurrently$fApplicativeConcurrently$fFunctorConcurrently$fMonoidConcurrentlyE$fSemigroupConcurrentlyE$fApplicativeConcurrentlyE$fBifunctorConcurrentlyE$fFunctorConcurrentlyE$fShowAsyncCancelled$fEqAsyncCancelledbase GHC.Conc.SyncThreadIdforkIOControl.ConcurrentforkOSforkOnforkIOWithUnmaskforkOnWithUnmaskghc-prim GHC.TypesIOData.Traversable Traversable Data.FoldablemapM_forM_TrueFalse