#z      !"#$%&'()*+,-./0123456789:; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  A Maybe-like poison wrapper.  GRecords an event where you were the last person to engage in the event ;Records an event where you were one of the people involved DAn individual record of an event, found in nested traces. Either a I channel write or read, or a barrier synchronisation, each with a unique  identifier for the barrier/(channel. The event will be recorded by B everyone involved, and a ChannelWrite will have the same channel H identifier as the corresponding channel-read. The identifiers are per  channel/>barrier, not per event. Currently, channels and barriers can C never have the same Unique as each other, but do not rely on this  behaviour. BA globally recorded event, found in CSP and VCR traces. Either a F channel communication (with a unique identifier of the channel) or a I barrier synchronisation (with a unique identifier of the barrier). The  identifiers are per channel/$barrier, not per event. Currently, I channels and barriers can never have the same Unique as each other, but  do not rely on this behaviour. % NChecks for poison, and either returns the value, or throws a poison exception Throws a poison exception. IAllows you to provide a handler for sections with poison. It is usually # used in an infix form as follows:  F (readChannel c >>= writeChannel d) `onPoison` (poison c >> poison d) CIt handles the poison and does not rethrow it (unless your handler 5 does so). If you want to rethrow (and actually, you'll find you usually  do), use onPoisonRethrow Like 0, this function allows you to provide a handler E for poison. The difference with this function is that even if the E poison handler does not throw, the poison exception will always be G re-thrown after the handler anyway. That is, the following lines of % code all have identical behaviour:  foo # foo `onPoisonRethrow` throwPoison ! foo `onPoisonRethrow` return () 3Poisons all the given items. A handy shortcut for  mapM_ poison. 1A class indicating that something is poisonable. Poisons the given item. DChecks if the given item is poisoned. If it is, a poison exception  will be thrown. Added in version 1.0.2. CA class representing a type of trace. The main useful function is , J but because its type is only determined by its return type, you may wish L to use the already-typed functions offered in each trace module -- see the  modules in Control.Concurrent.CHP.Traces. HRuns the given CHP program, and returns its return value and the trace. G The return value is a Maybe type because the process may have exited H due to uncaught poison. In that case Nothing is return as the result. The empty trace. (Pretty-prints the given trace using the Text.PrettyPrint.HughesPJ  module. HA monad transformer class that is very similar to MonadIO. This can be K useful if you want to add monad transformers (such as StateT, ReaderT) on  top of the  monad. /The central monad of the library. You can use runCHP and runCHP_ $ to execute programs in this monad. FAn enrolled wrapper for barriers that shows at the type-level whether J you are enrolled on a barrier. Enrolled Barriers should never be passed N to two (or more) processes running in parallel; if two processes synchronise A based on a single enroll call, undefined behaviour will result. )An internal dummy type for poison errors #  ,A trace type that does not record anything. NA classic CSP trace. It is simply the channel labels, and a list of recorded I events in sequence -- the head of the list is the first (oldest) event. TFlattens the events into a list. The resulting list may contain duplicates, and it I should not be assumed that the order relates in any way to the original  hierarchy. LA nested (or hierarchical) trace. The trace is an event hierarchy, wrapped K in a Maybe type to allow for representation of the empty trace (Nothing). UA data type representing a hierarchy of events. The count on the StructuralSequence @ count is a replicator count for that list of sequential items.  !"#  !"#&AA VCR (View-Centric Reasoning) trace. It is the channel labels, G accompanied by a sequential list of sets of recorded events. Each of F the sets is a set of independent events. The set at the head of the & list is the first-recorded (oldest). $%&'&'$% !"#$%&' (IThis type-class supports parallel composition of processes. You may use  the (- function to run a list of processes, or the ) operator " to run just a pair of processes. HIn each case, the composition waits for all processes to finish, either 6 successfully or with poison. At the end of this, if any process * exited with poison, the composition will rethrow this poison. If all I the processes completed successfully, the results will be returned. If G you want to ignore poison from the sub-processes, use an empty poison  handler and  with each branch. FRuns the given list of processes in parallel, and then returns a list M of the results, in the same order as the processes given. Will only return . when all the inner processes have completed. )IA useful operator for performing a two process equivalent of runParallel L that gives the return values back as a pair rather than a list. This also + allows the values to have different types *HRuns all the given processes in parallel and discards any output. Does _ not return until all the processes have completed. runParallel_ ps is effectively equivalent  to ( ps >> return (). GRuns all the processes in parallel and returns their results once they I have all finished. The length and ordering of the results reflects the " length and ordering of the input +IExecutes a forking block. Processes may be forked off inside (using the  ,C function). When the block completes, it waits for all the forked K off processes to complete before returning the output, as long as none of I the processes terminated with uncaught poison. If they did, the poison  is propagated (rethrown). ,JForks off the given process. The process then runs in parallel with this I code, until the end of the forking block, when all forked-off processes J are waited for. At that point, once all of the processes have finished, / if any of them threw poison it is propagated. -9A monad transformer used for introducing forking blocks. ()*+,-(*)-+,.HRuns a CHP program. You should use this once, at the top-level of your J program. Do not ever use this function twice in parallel and attempt to Q communicate between those processes using channels. Instead, run this function D once and use it to spawn off the parallel processes that you need. /Runs a CHP program. Like . but discards the output. 0ARuns the given action in a loop, executing it repeatedly until a 1 8 statement inside it has a False condition. If you use 0 without 1,  the effect is the same as . 1GContinues executing the loop if the given value is True. If the value I is False, the loop is broken immediately, and control jumps back to the  next action after the outer 0/ statement. Thus you can build pre-condition,  post-condition, and  mid-condition' loops, placing the condition wherever  you like. 2IWaits for the specified number of microseconds (millionths of a second). L There is no guaranteed precision, but the wait will never complete in less  time than the parameter given. Suitable for use in an alt*, but note that waitFor 0 is not the same  as skip. 2 0 </>+ x will not always select the first guard, A depending on x. Included in this is the lack of guarantee that  2 0 </> 2- n will select the first guard for any value F of n (including 0). It is not useful to use two waitFor guards in a  single alt anyway. NOTE:; If you wish to use this as part of a choice, you must use  -threaded 5 as a GHC compilation option (at least under 6.8.2). 3The classic skip process/+guard. Does nothing, and is always ready. Suitable for use in an alt. 4HThe stop guard. Its main use is that it is never ready in a choice, so M can be used to mask out guards. If you actually execute stop, that process K will do nothing more. Any parent process waiting for it to complete will  wait forever. 5DA monad transformer for easier looping. This is independent of the H CHP aspects, but has all the right type-classes defined for it to make & it easy to use with the CHP library.  ./012345./  5013426Like 9+ but enrolls on the given pair of barriers 7Like 9+ but enrolls on the given list of barriers 9HEnrolls on the given barrier, then executes the given function (passing K it in the enrolled barrier) and when that function body finishes, resigns Q from the barrier and returns the result. If a poison or IO exception is thrown G in the inside block, the barrier will be correctly resigned from, and  the exception rethrown. Do not attempt to return the C enrolled barrier out of the inner function and use it afterwards. :EResigns from a barrier, then executes the given action, and when the J action finishes, re-enrolls on the barrier and continues. This function  is designed for use from inside the body of the 9 function, to H temporarily resign from a barrier, do some things, then re-enroll. Do I not use the enrolled barrier inside the resign block. However, you may H enroll on the barrier inside this, nesting enroll and resign blocks as  much as you like 6789:89:67 ;DAn alt between several actions, with arbitrary priority. The first I available action is chosen (with an arbitrary choice if many guards are D available at the same time), its body run, and its value returned. <DAn alt between several actions, with arbitrary priority. The first J available action is chosen (biased towards actions nearest the beginning 6 of the list), its body run, and its value returned. = A useful operator to perform an ; !. This operator is associative, R and has arbitrary priority. When you have lots of guards, it is probably easier  to use the ;  function. ;  may be more efficent than  foldl1 (<->) >A useful operator to perform a < . This operator is : associative, and has descending priority (that is, it is E left-biased). When you have lots of actions, it is probably easier  to use the <  function. <  may be more efficent than  foldl1 (</>) ;<=>;=<>OSynchronises on the given barrier. You must be enrolled on a barrier in order N to synchronise on it. Returns the new phase, following the synchronisation. ?HA wrapper (usually around a channel-end) indicating that the inner item  is shared. Use the claim function to use this type. @DA channel type, that can be used to get the ends of the channel via B  and C AGets the channel'9s identifier. Useful if you need to be able to identify " a channel in the trace later on. B+Gets the reading end of a channel from its @ type. C+Gets the writing end of a channel from its @ type. DHA phased barrier that is capable of being poisoned and throwing poison. ? You will need to enroll on it to do anything useful with it. J For the phases you can use any type that satisfies Enum, Bounded and Eq. P The phase increments every time the barrier completes. Incrementing consists  of: *if p == maxBound then minBound else succ p. Examples of things that  make sense for phases:  The () type (see the 1 type). This effectively has a single repeating , phase, and acts like a non-phased barrier. V A bounded integer type. This increments the count every time the barrier completes.  But don'At forget that the count will wrap round when it reaches the end.  You cannot use 5 for a phase because it is unbounded. If you really ; want to have an infinitely increasing count, you can wrap  in a newtype and J provide a Bounded instance for it (with minBound and maxBound set to -1,  if you start on 0). K A boolean. This implements a simple black-white barrier, where the state  flips on each iteration. > A custom data type that has only constructors. For example, data MyPhases  = Discover | Plan | Move/. Haskell supports deriving Enum, Bounded and ! Eq automatically on such types. ?@ABCD ?@ABCD EOSynchronises on the given barrier. You must be enrolled on a barrier in order N to synchronise on it. Returns the new phase, following the synchronisation. F-Finds out the current phase a barrier is on. GFIf the barrier is not in the given phase, synchronises on the barrier  repeatedly until it is in the given phase H1Creates a new barrier with no processes enrolled IFCreates a new barrier with no processes enrolled, that will be on the K given phase. You will often want to pass in the last value in your phase C cycle, so that the first synchronisation moves it on to the first JICreates a new barrier with no processes enrolled and labels it in traces  using the given label KICreates a new barrier with no processes enrolled and labels it in traces  using the given label LHGets the identifier of a Barrier. Useful if you want to identify it in  the trace later on. MFA special case of the PhasedBarrier that has no useful phases, i.e. a  standard barrier. DEFGHIJKLM MHJDIKFGEL NLA helper function that uses the parallel strategies library (see the paper: K Algorithm + Strategy = Parallelism) to make sure that the value sent down D a channel is strictly evaluated by the sender before transmission. JThis is useful when you want to write worker processes that evaluate data  and send it back to some  harvester& process. By default the values sent T back may be unevaluated, and thus the harvester might end up doing the evaluation. O If you use this function, the value is guaranteed to be completely evaluated  before sending. Added in version 1.0.2. OLike e 4 but also associates a label with that channel in a H trace. You can use this function whether tracing is turned on or not, = so if you ever use tracing, you should use this rather than e . PA helper that is like e % but returns the reading and writing  end of the channels directly. QA helper that is like e % but returns the writing and reading  end of the channels directly. RGCreates a list of channels of the same type with the given length. If J you need to access some channels by index, use this function. Otherwise  you may find using ]  to be easier. SA helper that is like R $, but labels the channels according L to a pattern. Given a stem such as foo, it names the channels in the list  foo0, foo1, foo2, etc. TA helper that is like R #, but labels the channels with the K given list. The number of channels returned is the same as the length of  the list of labels UBGets all the reading ends of a list of channels. A shorthand for map  reader. VBGets all the writing ends of a list of channels. A shorthand for map  writer. XFClaims the given channel-end, executes the given block, then releases C the channel-end and returns the output value. If poison or an IO G exception is thrown inside the block, the channel is released and the  poison/exception re-thrown. \FA helper class for easily creating several channels of the same type. F The same type refers not only to what type the channel carries, but E also to the type of channel (one-to-one no poison, one-to-any with / poison, etc). You can write code like this:   (a, b, c, d, e) <- newChannels *To create five channels of the same type. ^5A class indicating that a channel can be written to. _*Writes from the given writing channel-end `HStarts the communication, then performs the given extended action, then + sends the result of that down the channel a4A class indicating that a channel can be read from. b)Reads from the given reading channel-end cHPerforms an extended read from the channel, performing the given action  before freeing the writer dFA class used for allocating new channels, and getting the reading and I writing ends. There is a bijective assocation between the channel, and O its pair of end types. You can see the types in the list of instances below. I Thus, newChannel may be used, and the compiler will infer which type of M channel is required based on what end-types you get from reader and writer. I Alternatively, if you explicitly type the return of newChannel, it will I be definite which ends you will use. If you do want to fix the type of K the channel you are using when you allocate it, consider using one of the  many W --like shorthand functions that fix the type. e2Allocates a new channel. Nothing need be done to  destroy/5de-allocate the channel when it is no longer in use. j;A writing channel-end type that allows poison to be thrown k;A reading channel-end type that allows poison to be thrown #?@ABCNOPQRSTUVWXYZ[\]^_`abcdefghijk#@deNOQP\]RTSAkjBCUVabc^_`X?iWgZhYf[ p(The writing end of a broadcast channel. qFThe reading end of a broadcast channel. You must enroll on it before $ you can read from it or poison it. lmnopqqponlmU ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq rLForever forwards the value onwards, unchanged. Adding this to your process 1 network effectively adds a single-place buffer. sHForever forwards the value onwards, in an extended rendezvous. This is  like r 1 but does not add any buffering to your network. ,extId is a unit of the associative operator |->|. t8A process that waits for an input, then sends it out on all its output T channels (in order) during an extended rendezvous. This is often used to send the L output on to both the normal recipient (without introducing buffering) and N also to a listener process that wants to examine the value. If the listener L process is first in the list, and does not take the input immediately, the I value will not be sent to the other recipients until it does. The name J of the process derives from the notion of a wire-tap, since the listener N is hidden from the other processes (it does not visibly change the semantics  for them). uBSends out a single value first (the prefix) then behaves like id. vBForever reads in a value, and then sends out its successor (using ). wGReads in a value, and sends it out in parallel on all the given output  channels. xOForever reads in a value, transforms it using the given function, and sends it I out again. Note that the transformation is not applied strictly, so don't A assume that this process will actually perform the computation. yHForever reads in a value, and then based on applying the given function G either discards it (if the function returns false) or sends it on (if  the function returns True). zGStreams all items in a Traversable container out in the order given by  7 on the output channel (one at a time). Lists, Maybe, J and Set are all instances of Traversable, so this can be used for all of  those. {CForever waits for input from one of its many channels and sends it " out again on the output channel. |HSends out the specified value on the given channel the specified number  of times, then finishes. }GForever sends out the same value on the given channel, until poisoned. @ Similar to the white-hole processes in some other frameworks. ~IForever reads values from the channel and discards them, until poisoned. @ Similar to the black-hole processes in some other frameworks. KForever reads a value from both its input channels in parallel, then joins Q the two values using the given function and sends them out again. For example,   join (,) c d will pair the values read from c and d and send out the % pair on the output channel, whereas join (&&) will send out the conjunction  of two boolean values,  join (==)) will read two values and output whether  they are equal or not, etc. HForever reads a pair from its input channel, then in parallel sends out @ the first and second parts of the pair on its output channels. Added in version 1.0.2. .A sorter process. When it receives its first Just x data item, it keeps L it. When it receieves a second, it keeps the lowest of the two, and sends L out the other one. When it receives Nothing, it sends out its data value, Q then sends Nothing too. The overall effect when chaining these things together I is a sorting pump. You inject all the values with Just, then send in a ; single Nothing to get the results out (in reverse order). FLike sorter, but with a custom comparison method. You should pass in  the equivalent of less-than: (<). rstuvwxyz{|}~rstuvwxyz{|}~IWires given processes up in a forward cycle. That is, the first process K writes to the second, and receives from the last. It returns the list of N wired-up processes, which you will almost certainly want to run in parallel. GWires the given processes up in a forward pipeline. The first process Q in the list is connected to the given reading channel-end (the first parameter) J and the writing end of a new channel, A. The second process is wired up J to the reading end of A, and the writing end of the next new channel, B. L This proceeds all the way to the end of the list, until the final process I is wired to the reading end of Z (if you have 27 processes in the list, L and therefore 26 channels in the middle of them) and the second parameter. R The list of wired-up processes is returned, which you can then run in parallel. A specialised version of '. Given a list of processes, composes M them into an ordered pipeline, that takes the channel-ends for the sticking K out ends of the pipeline and gives a process that returns a list of their ! results. This is equivalent to , with the return value fed  to (. Added in version 1.0.2. A specialised version of '. Given a list of processes, composes I them into a cycle and runs them all in parallel. This is equivalent to   with the return value fed into (. Added in version 1.0.2. JProcess composition. Given two processes, composes them into a pipeline, J like function composition (but with an opposite ordering). The function A is associative. Using wirePipeline will be more efficient than foldl1  (|->|) for more than two processes. ,The reversed version of the other operator.  The type that is an instance of   for process pipelines. See . Given a  (formed using its   instance) and I the channels to plug into the ends of the pipeline, returns the process  representing the pipeline. FThe pipeline will run forever (until poisoned) and you must run it in L parallel to whatever is feeding it the inputs and reading off the outputs. L Imagine that you want a process pipeline that takes in a pair of numbers, F doubles the first and adds one to the second. You could encode this  in an arrow using:  % runPipeline (arr (*2) *** arr (+1)) EArrows are more useful where you already have processes written that M process data and you want to easily wire them together. The arrow notation L is probably easier for doing that than declaring all the channels yourself ' and composing everything in parallel. HActs like a limited capacity FIFO buffer of the given size. When it is E full it accepts no input, and when it is empty it offers no output. IActs like a FIFO buffer with unlimited capacity. Use with caution; make O sure you do not let the buffer grow so large that it eats up all your memory. C When it is empty, it offers no output. It always accepts input. JActs like a FIFO buffer of limited capacity, except that when it is full, W it always accepts input and discards it. When it is empty, it does not offer output. JActs like a FIFO buffer of limited capacity, except that when it is full, M it always accepts input and pushes out the oldest item in the buffer. When ( it is empty, it does not offer output. JA function for running the given CHP process that wants console channels. N When your program finishes, the console channels are automatically poisoned,  but it'Ds good practice to poison them yourself when you finish. Only ever K run one of these processes at a time, or undefined behaviour will result. RWhen using this process, due to the way that the console handlers are terminated, T you may sometimes see a notice that a thread was killed. This is normal behaviour  (unfortunately). IA set of channels to be given to the process to run, containing channels  for stdin, stdout and stderr. !"#$%&'()*+,-./0123456789::;<=>>?@ABCDEEFGHIJKLMNOPQRSTUVWX Y Z [ \]^_`ab c d e f g h i j k l m n o p q r s t u v w x y z { | } ~             /6k  ]^    chp-1.0.2Control.Concurrent.CHP.TracesControl.Concurrent.CHP.MonadControl.Concurrent.CHP.Enroll&Control.Concurrent.CHP.Traces.TraceOff!Control.Concurrent.CHP.Traces.CSP(Control.Concurrent.CHP.Traces.Structural!Control.Concurrent.CHP.Traces.VCRControl.Concurrent.CHP.ParallelControl.Concurrent.CHP.AltControl.Concurrent.CHP.ChannelsControl.Concurrent.CHP.Barriers(Control.Concurrent.CHP.BroadcastChannelsControl.Concurrent.CHP.CommonControl.Concurrent.CHP.UtilsControl.Concurrent.CHP.ArrowControl.Concurrent.CHP.BuffersControl.Concurrent.CHP.Console Control.Concurrent.CHP.ProcessIdControl.Concurrent.CHP.PoisonControl.Concurrent.CHP.MutexControl.Concurrent.CHP.Event"Control.Concurrent.CHP.Traces.BaseControl.Concurrent.CHP.GuardControl.Concurrent.CHP.Basebase Control.MonadControl.Concurrent.CHP.CSPGHC.NumControl.Concurrent.CHPGHC.EnumData.Traversable Control.ArrowRecordedIndivEventBarrierSyncIndiv ChannelRead ChannelWrite RecordedEvent BarrierSync ChannelComm throwPoison onPoisonTraponPoisonRethrow poisonAll PoisonablepoisoncheckForPoisonTracerunCHPAndTrace emptyTrace prettyPrintMonadCHPliftCHPCHPEnrolledTraceOffrunCHP_CSPTracerunCHP_CSPTraceAndPrintCSPTracegetAllEventsInHierarchyrunCHP_StructuralTracerunCHP_StructuralTraceAndPrintStructuralTraceEventHierarchyStructuralParallelStructuralSequence SingleEventrunCHP_VCRTracerunCHP_VCRTraceAndPrintVCRTrace runParallel<||> runParallel_forkingforkForkingTrunCHPrunCHP_loopwhilewaitForskipstop LoopWhileT enrollPair enrollList EnrollableenrollresignaltpriAlt<->SharedChangetChannelIdentifierreaderwriter PhasedBarrier syncBarrier currentPhase waitForPhase newBarriernewPhasedBarriernewBarrierWithLabelnewPhasedBarrierWithLabelgetBarrierIdentifierBarrierwriteChannelStrictnewChannelWithLabel newChannelRW newChannelWRnewChannelListnewChannelListWithStemnewChannelListWithLabelsreaderswritersoneToOneChannelclaimanyToOneChanneloneToAnyChannelanyToAnyChannel ChannelTuple newChannelsWriteableChannel writeChannelextWriteChannelReadableChannel readChannelextReadChannelChannel newChannelAnyToAnyChannelOneToAnyChannelAnyToOneChannelOneToOneChannelChanoutChaninoneToManyChannelanyToManyChannelAnyToManyChannelOneToManyChannelBroadcastChanoutBroadcastChaninidextIdtapprefixsuccparDeltamapfilterstreammerger replicaterepeatconsumejoinsplitsortersorter' wireCycle wirePipelinepipelinecycle|->||<-|ProcessPipeline runPipeline fifoBufferinfiniteBufferoverflowingBufferoverwritingBufferconsoleProcess ConsoleChanscStdincStdoutcStderr rootProcessIdemptyProcessIdpidLessThanOrEqual ProcessId ProcessIdPartParSeq WithPoisonNoPoison PoisonItem claimMutexnewMutex releaseMutexMutexnewEvent enrollEvent resignEvent retractOffers completeEvent enableEvents disableEventscheckEventForPoison poisonEventOfferSetEventrecordEventLast recordEventgetName nameEventnameIndivEventensureAllNamedensureAllNamedIndivmergeSubProcessTracesshouldMakeNewSetVCRcompress addParEventsH addSeqEventHaddRLE labelEvent labelUnique blankTraces StructuredRevSeqParStrEvent SubTraceStore VCRTraceRev CSPTraceRev Hierarchy ChannelLabels TraceStoreNoTraceTraceT RecEvents skipGuardbadGuard stopGuard guardWaitForGuard NestedGuards EventGuardBadGuard StopGuard SkipGuard TimeoutGuard checkPoison PoisonErrorpullOutStandardpullOutAltable liftTrace wrapPoison unwrapPoison liftPoisonliftSTM getProcessIdrunCHPProgramWithrunCHPProgramWith'CHP'AltableT getAltable getStandard AltableTRetPoisonTrunParallelPoisonforeversyncBarrierWithIntegerrecAsbuildOnEventPoison scopeBlockmapMArrow