~sҎ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } ~   Trustworthy%&0Thread pools support some standard operations...   Safe %Arrows that have a strictness effect.      Safe Trustworthy0Thrown by the writer function. Construct a channel from a list.^Take the first element from a channel, and a channel representing the remainder of the output.Create a new channel. The first return value is a function that can be used to add values to the channel. The second return value is the channel itself.The first return value is a procedure that returns values from the channel successively, starting from the position of the parameter channel. The second thunk can be used to retrieve the position of the channel after all the reads made using the first thunk.HCreate a channel which is initially empty, but accumulates new elements.    SafeAT ! ! Trustworthy09:;T"=A type class of arrows that support some form of concurrency.#Runs an associative folding function on the given array. Note: this function only spawns enough threads to make effective use of the  capabilities. Any two list elements may be processed sequentially or concurrently. To get parallelism, you have to set the numCapabilities value, e.g. using GHC's +RTS -N flag.$TThe first parameter is the number of computations which are indexed from 0 to n - 1.'For internal errors. If a procedure throws this, some threads it created may still be running. It is thrown separately from ExceptionList.)%For exceptions caused by caller code./The next function takes an implicit parameter ?seq. Set it to True if you want to only spawn threads for the capabilities (same as  assocFold^; good for speed). If you need all the actions to be executed concurrently, set it to False.02Version of concF specialized for two computations.3mRuns several computations in parallel, and returns one of their results (terminating the other computations)."#$%&'()*+,-./01234567"#$%&'()*+,-./0123)*'(+"#$%&,-./0123"#$%&'()*+,-./01234567 Trustworthy%&2OT <The < arrow includes a set of primitives that may be executed concurrently. Programs are incrementally optimized as they are put together. A program may be optimized once, and the result saved for repeated use.Notes:7The exact output of the optimizer is subject to change.The program must be a finite data structure, or optimization may diverge. Therefore recursive definitions do not work, unless something is done to limit the depth.B Obtain a = program from an < program. Obtain a =/ program but postcompose with another program. 1Mapping is the primary way of constructing nested data parallel programs. It applies an (arrow) transformation to each element of an array uniformly. A form of flattening transformation is applied to nested maps (following the NESL paper). The flattening transformation converts two levels of  into one level.GAccess one index of an array.HAn operation analogous to , HD combines two packed arrays into a single array element by element.II and H are inverses.JbConcatenation flattens out nested layers of arrays. The key operation used to implement is erasing marks; erasing marks throws away the structure that would delineate the edges of arrays; effectively flattening them into one array. The operation is divided into packing and erasing marks, in the hope that the packing stage will fuse with an adjacent unpack.K`Supplies an array of a repeated value paired with the index of each element. Arguably adjacent K^s should fuse; however this is hard to implement, so I have opted to provide a more powerful K\ that works on arrays of indices; it generates arrays of indices lexicographically ordered.M@Replacements for common arrow functions make fusing work better.An evaluator for =4 arrows. A structural arrow may be obtained from an < arrow by either B or .SDiscussion of complexity bounds for various operations [these are provided c <= k]:Cost of 3 is O(k/c log^3(k)) in the number of subelements k.Cost of  and 9 is O(k/c log^3(k) + k) in the number of subelements k. = is O(n) in the worst case in the number of spine elements n.2 costs O(f) assuming unlimited capabilities where a runs in O(f) time. and  are both O(1).PEvaluates arrows.M:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]:;<=>?@ABCDEFGHIJKLMNOPQRSTU:;>?@A=<BCDKLEFGHIJMNOPQRSTU9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]SafeaEdge relaxation.b)The Bellman-Ford shortest path algorithm.d Cycle finding_`abcd_`abcd_`abcd_`abcd Trustworthy %&9;FTAn automatic deadlock avoidance algorithm prevents deadlocks from occurring, by dynamically controlling the way threads use locks, to prevent the appearance of cycles in the ownership graph.)Another way of stating the intuition is: the evolution of multiple locks can be visualized as a multi-dimensional space, with the regions in which locks are held coloured black. This algorithm attempts to cover up the concave spaces in these regions, in which the evolution can get stuck.rIt is important to ensure that the management of the ownership graph is fast. There are probably a lot of ways to do this; the one used here is to use a concurrent hash table; and only process nodes that are in the same connected component as the node in question. This at least gives a system a performance related to the size of its interacting components.mGAcquire a lock. In order to implement deadlock avoidance, the function me requires that all locks a thread may take while holding the given lock are annotated in parameter  possiblyAcq.While programs with locks have rare deadlock conditions, they have common lock use patterns in-thread. If we throw an exception whenever lock use patterns are not properly declared, all lock use patterns will show up in testing and can be annotated.Complexity overview:Let N = the number of locks.JLet K = the size of the largest directed component of the ownership graph.#Let C = the number of capabilities.m3 runs in O(K log N + K^3/C) time [provided C <= K].nRelease a lock so acquired.n runs in O(log N) time.o%Test: The dining philosophers problemefghijklmnopqrstuvw efghijklmno jklhiefgmnoefghijklmnopqrstuvw Safe:y yyy  Trustworthy0}$Filters the AList using a predicate.~dFolds the AList with a function, that must be associative. This allows parallelism to be introduced.(Combine monoid elements to get a result.Length of an AList..Find the first element satisfying a predicate.Concatenate an AList of ALists.z{|}~ z|{}~ z{|}~z{|}~     !"#$%&'()*+,-./001123456789:;<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnnopqrstuvwxyz{|} ~    2  %BD" .ConcurrentUtils-0.4.5.0-JkcI7lveP4t5euQTOZdyWkControl.CUtils.ThreadPoolControl.CUtils.StrictArrowControl.CUtils.FChanControl.CUtils.DynControl.CUtils.ConcControl.CUtils.DataParallelData.BellmanFordControl.CUtils.DeadlockControl.CUtils.ChannelControl.CUtils.AListControl.CUtils.SplitBoxedThreadPoolNoPool InterruptiblestopPool ThreadPool addToPool$fThreadPoolBoxedThreadPool$fThreadPoolNoPool$fInterruptiblePool$fThreadPoolPoolStrictforce$fStrictKleisli $fStrict(->)DoneReadingExceptionChan listToChantakeChan tryTakeChannewChan makeConsumer chanContentsdupChan$fExceptionDoneReadingException$fShowDoneReadingExceptionDynvaluemakeDyn determineType $fShowDyn$fEqDyn Concurrent arr_assocFold arr_concF_ arr_concF arr_oneOfF ConcException ExceptionList assocFoldconcF_concFconc_concconcP progressConcFoneOfFoneOf$fConcurrent(->)$fConcurrentKleisli$fExceptionConcException$fExceptionExceptionList$fShowExceptionList$fShowConcExceptionEqualA StructuralArrCnewArrayinjectprojectunAmapA'liftAsplitOffassocindexAzipAunzipAconcatAcountAcountA'dupAfstAsndAevalnQueenssortingpermute dotProduct transpose' $fArrowApplyA$fCategoryTYPEStructural$fShowStructural$fArrowChoiceA$fArrowA$fCategoryTYPEA $fShow(->) $fFunctorTree $fFunctorArrCkeys mapWithKey relaxEdge bellmanFord retrievePathcyclesLockSafetyExceptionLockTakenTwiceLockNotDeclaredBoxedAbstractLock AbstractLocklockunlockacquirereleasetest$fExceptionLockSafetyException$fHashableMVar $fShowMVar$fHashableBoxedAbstractLock$fShowBoxedAbstractLock$fAbstractLockBoxedAbstractLock$fEqBoxedAbstractLock$fAbstractLockMVar$fShowLockSafetyExceptionChannelAListAppendList filterAListmonoidlenAList findAList concatAList$fFoldableAList$fTraversableAList$fFunctorAList$fAlternativeAList$fApplicativeAList$fMonadPlusAList $fMonadAList $fEqAList $fOrdAList $fShowAList $fDataAListPool createPoolsplitaddChan simpleConc_divideUp getExceptions partConc_ unsafeFreeze' partConcF partOneOfFunA'mapAMapbaseGHC.Listzipeval0 ClearMarksPackUnpackCombineSeparateCompIdProductLiftCountIndexSplitDupFstSndTreeNodesHeadsTailsLastfromTopairUp fastConcat reassociatepackflattenscrubIdsmirror forcePair binarySearchpackImpl unpackImpl checkThreats checkThreats2 nQueensImpl reachableAbortresourceresourceThreadshazardinsertupdateResource philosopherControl.Concurrent.ChanwriteList2ChangetChanContents isEmptyChan unGetChanreadChan writeChannoNils assocFold0