h&BS=s>      !"#$%&'()*+,-./0123456789:;<=(c) Simon Marlow 2012BSD3 (see the file LICENSE)!Simon Marlow  provisional#non-portable (requires concurrency) Trustworthy)*%- async-poolA 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") async-pool"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-pool4The number of available execution slots in the pool.? async-pool2Nodes in the task graph that are waiting to start. async-poolA  manages a collection of possibly interdependent tasks, such that tasks await execution until the tasks they depend on have finished (and tasks may depend on an arbitrary number of other tasks), while independent tasks execute concurrently up to the number of available resource slots in the pool.Results from each task are available until the status of the task is polled or waited on. Further, the results are kept until that occurs, so failing to ever wait will result in a memory leak.Tasks may be cancelled, in which case all dependent tasks are unscheduled.@ async-poolThe task graph represents a partially ordered set P with subset S such that for every x D S and y D P, either x D y or x is unrelated to y. Stated more simply, S is the set of least elements of all maximal chains in P. In our case, D relates two uncompleted tasks by dependency. Therefore, S is equal to the set of tasks which may execute concurrently, as none of them have incomplete dependencies.We use a graph representation to make determination of S more efficient (where S is just the set of roots in P expressed as a graph). Completion status is recorded on the edges, and nodes are removed from the graph once no other incomplete node depends on them.A async-pool9Tokens identify tasks, and are provisioned monotonically.B async-poolA B2 is a unique identifier for a task submitted to a . async-pool2Spawn an asynchronous action in a separate thread. async-poolLike  but using C internally.  async-poolLike  but using D internally.  async-poolLike  but using E internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.  async-poolLike   but using F internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.G async-poolLike H6 but waits until there are free slots in the TaskGroupI async-poolReturn the next available thread identifier from the pool. These are monotonically increasing integers.  async-poolSpawn 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 right $ \b -> waitEither a b' async-poolLike &, but the result is ignored.( async-poolRun 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 bL async-poolFork 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.MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~?>A@B HGI K !"#$%&'(L Safe-Inferred<) async-poolThe ) Applicative and Monad allow for task dependencies to be built using Applicative and do notation. Monadic evaluation is sequenced, while applicative Evaluation is concurrent for each argument. In this way, mixing the two builds a dependency graph via ordinary Haskell code. async-poolReturn a list of actions ready for execution, by checking the graph to ensure all dependencies have completed. async-poolReturn a list of tasks ready to execute, and their related state variables from the dependency graph.* async-poolCreate a task pool for managing many-to-many acyclic dependencies among tasks. async-poolUse a task pool for a bounded region. At the end of the region, + will block until all tasks have completed.+ async-poolCreate a task group for executing interdependent tasks concurrently. The number of available slots governs how many tasks may run at one time., async-poolExecute tasks in a given task group. The number of slots determines how many threads may execute concurrently.- async-poolCreate a task group within the given pool having a specified number of execution slots, but with a bounded lifetime. Leaving the block cancels every task still executing in the group.. async-poolCreate both a pool, and a task group with a given number of execution slots, but with a bounded lifetime. Once the given function exits, all tasks (that are still running) in the TaskGroup will be cancelled./ async-poolGiven parent and child tasks, link them so the child cannot execute until the parent has finished.0 async-poolGiven parent and child tasks, link them so the child cannot execute until the parent has finished. This function does not check for introduction of cycles into the dependency graph, which would prevent the child from ever running.1 async-poolEquivalent to , but acts in STM so that / may be called after the task is created, but before it begins executing.2 async-poolSubmit a task which begins execution after all its parents have completed. This is equivalent to submitting a new task with 1= and linking it to its parents using 'mapM makeDependent'.3 async-poolSubmit a task that begins execution only after its parent has completed. This is equivalent to submitting a new task with 1' and linking it to its parent using /. async-pool3Helper function used by several of the variants of 4 below.4 async-poolExecute a group of tasks within the given task group, returning the results in order. The order of execution is random, but the results are returned in order.5 async-poolExecute a group of tasks within the given task group, returning the results in order as an Either type to represent exceptions from actions. The order of execution is random, but the results are returned in order.6 async-poolExecute a group of tasks within the given task group, ignoring results.7 async-poolExecute a group of tasks within the given task group, ignoring results, but returning a list of all exceptions.8 async-poolExecute a group of tasks, but return the first result or failure and cancel the remaining tasks.9 async-pool!Given a list of actions yielding  results, execute the actions concurrently (up to N at a time, based on available slots), and  each pair of results concurrently as they become ready. The immediate result of this function is an  representing the final value."This is similar to the following: mconcat  $ mapTasks n actions, except that intermediate results can be garbage collected as soon as they've been merged. Also, the value returned from this function is an * which may be polled for the final result.Lastly, if an  Exception occurs in any subtask, the final result will also yield an exception -- but not necessarily the first or last that was caught.: async-poolExecute a group of tasks concurrently (using up to N active threads, depending on the task group), and feed results to a continuation as soon as they become available, in random order. The continuation function may return a monoid value which is accumulated to yield a final result. If no such value is needed, simply provide ().; async-poolmaps an IO-performing function over any  Traversable data type, performing all the IO actions concurrently, and returning the original data structure with the arguments replaced by the results. For example, mapConcurrently works with lists: 8pages <- mapConcurrently getURL ["url1", "url2", "url3"]< async-poolRun a value in the )7 monad and block until the final result is computed.= async-pool Lift any  action into a ). This is a synonym for ./ async-pool Handle of task doing the waiting async-pool+Handle of task we must wait on (the parent)0 async-pool Handle of task doing the waiting async-pool+Handle of task we must wait on (the parent)9 async-pool&Task group to execute the tasks within async-pool!Set of Monoid-yielding IO actions async-poolReturns the final result task)*+,-./0123456789:;<=((c) Simon Marlow 2012, John Wiegley 2014BSD3 (see the file LICENSE)$John Wiegley  provisional#non-portable (requires concurrency) Safe-Inferred<>  !"#$%&'()*+,-./0123456789:;<=>.-*+, 132/0  "!#$%465789:)<=&'(;      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHFIJFIKFILMNOFIPQRSTUSTVSTWSTXSTYSTZST[ST\ST]ST^ST_ST`SabSacSdeSfgSfhSfiSfjSfkSflSfmSfnSfoSfpSfqSfrSfsSftSfuSfvSfwSfxSfySfzSf{Sf|Sf}Sf~SfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSfSf FFF,'async-pool-0.9.2-6YaXfhCXIJCKGusDANq6JrControl.Concurrent.Async.Pool#Control.Concurrent.Async.Pool.Async&Control.Concurrent.Async.Pool.Internal ConcurrentlyrunConcurrentlyAsync taskHandle TaskGroupPoolasync asyncBoundasyncOnasyncWithUnmaskasyncOnWithUnmask withAsyncwithAsyncBound withAsyncOnwithAsyncWithUnmaskwithAsyncOnWithUnmaskwait waitCatchpollwaitSTM waitCatchSTMpollSTMcancel cancelWith cancelAll waitAnyCatchwaitAnyCatchCancelwaitAny waitAnyCancelwaitEitherCatchwaitEitherCatchCancel waitEither waitEither_waitEitherCancelwaitBothlinklink2racerace_ concurrentlyTask createPoolcreateTaskGroup runTaskGroupwithTaskGroupIn withTaskGroup makeDependentunsafeMakeDependentasyncSTM asyncAfterAll asyncAftermapTasks mapTasksE mapTasks_ mapTasksE_mapRace mapReducescatterFoldMapMmapConcurrentlyrunTasktaskavailpendingtaskstokensHandlebaseControl.ConcurrentforkOS GHC.Conc.SyncforkOnforkIOWithUnmaskforkOnWithUnmaskasyncUsingLazy asyncUsing nextIdentthrowTo cancelWith' forkRepeat"fgl-5.8.1.1-LEQKyODhLwpJyTDeIvORNiData.Graph.Inductive.Query.BFSlesplbftespbftbfebfenlevelnlevelbfsbfsWithbfsnbfsnWith!Data.Graph.Inductive.PatriciaTreeGrUGr&Data.Graph.Inductive.Internal.RootPathRTreeData.Graph.Inductive.Graph prettyPrintprettifyequalhasNeighborAdjhasLEdge hasNeighborhasEdgedeg'indeg'outdeg'inn'out'lpre'lsuc'pre'suc' lneighbors' neighbors'labNode'lab'node'degindegoutdeginnoutlprelsucpresuc lneighbors neighborslabcontextsubgraph labfilternfilter labnfilter gfiltermapmkUGraphbuildGrdelEdgesdelNodesinsEdgesinsNodes delAllLEdgedelLEdgedelEdgedelNodeinsEdgeinsNodegelemnewNodes edgeLabeltoLEdgetoEdgeedgesnodesnemapemapnmapgmapufoldsizeorderNodeLNodeUNodeEdgeLEdgeUEdgePathLPathLPunLPathUPathAdjContextMContextDecompGDecompUContextUDecompGraphlabEdges nodeRangenoNodesmatchAnylabNodesmkGraphmatchemptyisEmptyDynGraphOrdGrunOrdGr _asyncWait taskGrouppool SomeTMVar TaskGraphStatusPending CompletedStateStartedReadyStarting waitTMVarsyncPool waitSomeTMVar getTaskVar getThreadId cleanupTaskwithAsyncUsingcatchAlltryAll rawForkIO rawForkOn getReadyNodes getReadyTaskswithPoolmapTasksWorkerGHC.BaseMonoidmappendghc-prim GHC.TypesIOControl.Monad.IO.ClassliftIOrunTask'extraWorkerWhileBlocked