rYQ      !"#$%&'()*+,-./0123456789: ; < = > ? @ A B C D E F G H I J K L M NOPQ R S T U V W X Y Z [\]^_`abcdefghijklmnopq rstuvwxyz{|}~ HA wrapper (usually around a channel-end) indicating that the inner item  is shared. Use the claim function to use this type. A Maybe-like poison wrapper. "0The type of an event in the CSP and VCR traces. &ClockSync was added in version 1.2.0. LThe extra parameter on ChannelComm and BarrierSync (which are the result of R showing the value sent and phase ended respectively) was added in version 1.5.0.     .      !"#$%&'()*+,-:Variable used to signal the process once a choice is made (The id of the process making the choice >The list of options. Each option has a signalvalue to return 7 if chosen, and a list of events (conjoined together). A So this list is the disjunction of conjunctions, with a little  more information. 8True if it can commit to waiting. If there is an event E combination ready during the transaction, it will chosen regardless @ of the value of this flag. However, if there no events ready, B passing True will leave the offers there, but False will retract  the offers. .KGiven the variable used to signal the process, and the list of events that O were involved in its offers, attempts to disable the events. If the variable c has been signalled (i.e. has a Just value), that is returned and nothing is done, if the variable O has not been signalled (i.e. is Nothing), the events are disabled and Nothing  is returned. /0&'(-./0&'(-./00123456789:;<=>?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. 7The type u item is the unique identifier of the channelbarrierclock, and the 2 Integer is a sequence identifier for that channelbarrierclock (first sync J is 0, second sync is 1, etc), and finally the String shows the value-sent phase-endedtime  involved. +ClockSyncIndiv was added in version 1.2.0. \The type became parameterised, and the Show and Read instances were added in version 1.3.0. MThe String parameters on ChannelWrite, ChannelRead and BarrierSyncIndiv were  added in version 1.5.0.  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. 0The type became parameterised in version 1.3.0. Added in version 1.3.0. Added in version 1.3.0. @ABCDEFGHIGRecords an event where you were the last person to engage in the event JK;Records an event where you were one of the people involved LMNOPQRSTUVW0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVW0143223458766789;::;<=>=>?  @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefXYZ[\]^_`abcdefXYZ[YZ[\`_^]]^_`abcdef7ghijkl1A 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. ?The trace type involved became parameterised in version 1.3.0. 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. Added in version 1.3.0. 2A monad transformer class that is very similar to MonadIO. This can be 7 useful if you want to add monad transformers (such as StateT, ReaderT) on  top of the  monad. mnop/The central monad of the library. You can use  #Control.Concurrent.CHP.Monad.runCHP and  $Control.Concurrent.CHP.Monad.runCHP_ to execute programs in this  monad. 5The Alternative instance was added in version 2.2.0. qrFAn 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. sNAn implementation of liftIO for the CHP monad; this function lifts IO actions  into the CHP monad. Added in version 2.2.0. tuvwxNChecks for poison, and either returns the value, or throws a poison exception yThrows a poison exception. IAllows you to provide a handler for sections with poison. It is usually # used in an infix form as follows:  J (readChannel c >>= writeChannel d) `onPoisonTrap` (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  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. z{|}~EAn alt between several actions, with descending priority. The first J available action is chosen (biased towards actions nearest the beginning 5 of the list), its body run, and its value returned. MWhat priority means here is a difficult thing, and in some ways a historical ; artifact. We can group the guards into three categories:  Q synchronisation guards (reading from and writing to channels, and synchronising  on barriers)  time-out guards (such as $Control.Concurrent.CHP.Monad.waitFor)  dummy guards (!Control.Concurrent.CHP.Monad.skip, !Control.Concurrent.CHP.Monad.stop  and things like IO actions) LThere exists priority when comparing dummy guards to anything else. So for  example,   priAlt [ skip, x ] >Will always select the first guard (the skip guard), whereas:   priAlt [ x , skip ] AIs an effective way to poll and see if x is ready, otherwise the !Control.Concurrent.CHP.Monad.skip will N be chosen. However, there is no priority between synchronisation guards and % time-out guards. So the two lines:   priAlt [ x, y ]  priAlt [ y, x ] NMay have the same or different behaviour (when x and y are not dummy guards), N there is no guarantee either way. The reason behind this is that if you ask  for:  , priAlt [ readChannel c, writeChannel d 6 ] 0And the process at the other end is asking for:  , priAlt [ readChannel d, writeChannel c 8 ] LWhichever channel is chosen by both processes will not satisfy the priority O at one end (if such priority between channels was supported). If you do want P priority that is globally consistent, look at the channel and barrier creation - methods for ways to set priority on events.  HThe stop guard. Its main use is that it is never ready in a choice, so : can be used to mask out guards. If you actually execute  , that process K will do nothing more. Any parent process waiting for it to complete will  wait forever. 8The type of this function was generalised in CHP 1.6.0. 7ghijklmnopqrstuvwxyz{|}~ 7ghijklhijklmponnopqrqrsstuvwxyz{|}~ !DA channel type, that can be used to get the ends of the channel via #  and $ "Gets the channel'9s identifier. Useful if you need to be able to identify " a channel in the trace later on. #+Gets the reading end of a channel from its ! type. $+Gets the writing end of a channel from its ! type. %A writing channel-end type. See $ to obtain one, and WritableChannel for how to use one. #Eq instance added in version 1.1.1 &A reading channel-end type. See # to obtain one, and ReadableChannel for how to use one. #Eq instance added in version 1.1.1 !"#$%&!"#$"#$%&'QOptions for channel creation; a function to show the inner data, and an optional M label (both only affect tracing). These options can be passed to newChannel'. Added in version 1.5.0. ()HAdded in version 2.1.0. Priority is per-event, static and system-wide. N If it is possible at any given moment for a process to resolve a choice one  of several ways, the channel/-barrier with the highest priority is chosen. N If the choice is a conjunction and all events in one conjunction are higher U than all the events in the other, the higher one is chosen (otherwise no guarantees O are made). The default is zero, and the range is the full range of Int (both  positive and negative). *+,FA 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.  Thus, 18 may be used, and the compiler will infer which type of : channel is required based on what end-types you get from # and $. 5 Alternatively, if you explicitly type the return of 1 , 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 oneToOneChannel--like shorthand functions that fix the type. -Like 17 but allows you to specify a way to convert the values V into Strings in order to display them in the traces, and a label for the traces. If  you don't use traces, you can use 1. Added in version 1.5.0. .:Determines if two channel-ends refer to the same channel. *This function was added in version 1.4.0. /The default: don't show anything, don't label anything Added in version 1.5.0. 0LUses the Show instance for showing the data in traces, and the given label. Added in version 1.5.0. 12Allocates a new channel. Nothing need be done to  destroy/5de-allocate the channel when it is no longer in use. HThis function does not add any information to the traces: see newChannel' for  that purpose. 5In version 1.5.0, this function was moved out of the , class, but that Q should only matter if you were declaring your own instances of that class (very  unlikely). 2A helper that is like 1% but returns the reading and writing  end of the channels directly. 3A helper that is like 1% but returns the writing and reading  end of the channels directly. 4GCreates 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  newChannels to be easier. 5A helper that is like 4$, 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. 6A helper that is like 4#, 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 7GLabels a channel in the traces. It is easiest to do this at creation. I The effect of re-labelling channels after their first use is undefined. Added in version 1.5.0. !'()*+,-./01234567!,-.1'()*+/0324657'()*+()*+,-.-./012345678,A trace type that does not record anything. 9A type-constrained version of ". This is semantically identical  to runCHP', but this function is useful with the qcCHP' function in the testing  module. 898989 :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. ;<QA helper function for pulling out the interesting bit from a CSP trace processed  by labelAll. Added in version 1.5.0. =>:;<=>:;<=>:;;<=> ?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). @AUA data type representing a hierarchy of events. The count on the StructuralSequence @ count is a replicator count for that list of sequential items. PThe Show, Read, Foldable and Traversable instances were added in version 1.3.0. ,The Eq instance was added in version 1.5.0. BCDETFlattens 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. FXA helper function for pulling out the interesting bit from a Structural trace processed  by labelAll. Added in version 1.5.0. GH ?@ABCDEFGH ?@ADCBFGHE ?@@ADCBBCDEFGH IAA 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). /The type became parameterised in version 1.3.0 JKQA helper function for pulling out the interesting bit from a VCR trace processed  by labelAll. Added in version 1.5.0. LMIJKLMIJKLMIJJKLMNATakes a VCR trace and forms all the possible CSP traces (without = duplicates) that could have arisen from the same execution. LThis is done by taking all permutations of each set in the VCR trace (which P is a list of sets) and concatenating them with the results of the same process T on the rest of the trace. Thus the maximum size of the returned set of CSP traces I is the product of the sizes of all the non-empty sets in the VCR trace. *This function was added in version 1.5.0. OHTakes a structural trace and forms all the possible VCR traces (without = duplicates) that could have arisen from the same execution. MThis is done -- roughly speaking -- by replaying the structural trace in all O possible execution orderings and pulling out the VCR trace for each ordering. *This function was added in version 1.5.0. PHTakes a structural trace and forms all the possible CSP traces (without = duplicates) that could have arisen from the same execution. MThis is done -- roughly speaking -- by replaying the structural trace in all O possible execution orderings and pulling out the CSP trace for each ordering. 0It should be the case for all structural traces t that do not use conjunction (every and  '(<&>)'):  @ structuralToCSP t =~= (concatMap vcrToCSP . structuralToVCR) t O where a =~= b = or [a' == b' | a' <- permutations a, b' <- permutations b] *This function was added in version 1.5.0. + 89:;<=>?@ABCDEFGHIJKLMNOP   NPONOP Q9A monad transformer used for introducing forking blocks. RIThis type-class supports parallel composition of processes. You may use  the R- function to run a list of processes, or the U 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. 1In version 1.5.0, a bug was introduced such that  runParallel [] would deadlock; " this was fixed in version 1.5.1. SEA shorthand for applying mapM in parallel; really the composition of R  and . Added in version 1.5.0. TFA shorthand for applying mapM_ in parallel; really the composition of W  and . Added in version 1.5.0. U=A useful operator for performing a two process equivalent of R L that gives the return values back as a pair rather than a list. This also + allows the values to have different types VAn operator similar to U1 that discards the output (more like an operator  version of W). Added in version 1.1.0. WHRuns all the given processes in parallel and discards any output. Does 5 not return until all the processes have completed. W ps is effectively equivalent  to R ps >> return (). 1In version 1.5.0, a bug was introduced such that runParallel_ [] would deadlock; " this was fixed in version 1.5.1. 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 X>An implementation of lift for the ForkingT monad transformer. Added in version 2.2.0. YIExecutes a forking block. Processes may be forked off inside (using the  ZC 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). ZJForks off the given process. The process then runs in parallel with this  code, until the end of the Y& 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. QRSTUVWXYZ RWUVSTQXYZ QRSTUVWXYZ [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. ]Exactly the same as 9. Useful only because it mirrors a different definition  from the chp-spec library. Added in version 2.2.0. ^Acts as const id@. Useful only because it mirrors a different definition in the  chp-spec library. Added in version 2.2.0. _Acts as const id@. Useful only because it mirrors a different definition in the  chp-spec library. Added in version 2.2.0. `HAllows embedding of the CHP monad back into the IO monad. The argument K that this function takes is a CHP action (with arbitrary behaviour). The A function is monadic, and returns something of type: IO a. This I is an IO action that you can now use in the IO monad wherever you like. 8 What it returns is the result of your original action. MThis function is intended for use wherever you need to supply an IO callback S (for example with the OpenGL libraries) that needs to perform CHP communications. R It is the safe way to do things, rather than using runCHP twice (and also works 9 with CSP and VCR traces -- but not structural traces!). a9A convenient version of embedCHP that ignores the result b;A helper like embedCHP for callbacks that take an argument c:A convenient version of embedCHP1 that ignores the result dIWaits 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 Control.Concurrent.CHP.Alt.alt, but note that d 0 is not the same  as e. d 0 Control.Concurrent.CHP.Alt.</>+ x will not always select the first guard, A depending on x. Included in this is the lack of guarantee that  d 0 Control.Concurrent.CHP.Alt.</> d- n will select the first guard for any value 2 of n (including 0). It is not useful to use two d guards in a  single Control.Concurrent.CHP.Alt.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). eThe classic skip process/+guard. Does nothing, and is always ready. Suitable for use in an Control.Concurrent.CHP.Alt.alt. fActs as const liftIO_CHP@. Useful only because it mirrors a different definition in the  chp-spec library. Added in version 2.2.0.  [\]^_`abcdef[\`abce d]f^_ [\]^_`abcdef ghHEnrolls 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. iEResigns 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 h 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 jHJust like enroll, but starts with an already enrolled item. During the M body, you are enrolled twice -- once from the original enrolled item (which K is still valid in the body) and once from the new enrolled item passed to N the inner function. Afterwards, you are enrolled once, on the original item  you had. *This function was added in version 1.3.2. kLike h+ but enrolls on the given pair of barriers lLike h+ but enrolls on the given list of barriers mLGiven a command to allocate a new barrier, and a list of processes that use N that barrier, enrolls the appropriate number of times (i.e. the list length) P and runs all the processes in parallel using that barrier, then returns a list  of the results. 0If you have already allocated the barrier, pass  return bar as the first parameter. Added in version 1.7.0. nop*Like enrollAll, but discards the results. Added in version 1.7.0. ghijklmnop ghijklmpno ghihijklmnopqHA phased barrier that is capable of being poisoned and throwing poison. ? You will need to enroll on it to do anything useful with it. 4 For the phases you can use any type that satisfies ,  and . 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  provide a 8 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 ,  and   automatically on such types. 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. qqrBGets all the reading ends of a list of channels. A shorthand for map  reader. sBGets all the writing ends of a list of channels. A shorthand for map  writer. tFClaims 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. #$%&rst&%#$rstrst uvwxy*A type-constrained version of newChannel. z(A type-constrained version of newChannel'. Added in version 1.5.0. {*A type-constrained version of newChannel. |*A type-constrained version of newChannel. }*A type-constrained version of newChannel. ~(A type-constrained version of newChannel'. Added in version 1.5.0. (A type-constrained version of newChannel'. Added in version 1.5.0. (A type-constrained version of newChannel'. Added in version 1.5.0. uvwxyz{|}~ xyzv|w{~u} uvwxyz{|}~ 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. OLike extWriteChannel, but allows a value to be returned from the inner action. *This function was added in version 1.4.0. 4A class indicating that a channel can be read from. )Reads from the given reading channel-end HPerforms an extended read from the channel, performing the given action  before freeing the writer A useful synonym for flip writeChannel. Especially useful with claim  so that instead of writing "claim output (flip writeChannel 6) you can write  claim output (writeValue 6). Added in version 1.5.0. EA helper function that uses the parallel strategies library (see the  paper: ""Algorithm + Strategy = Parallelism", P.W. Trinder et al, JFP  8(1) 1998,   Hhttp://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html) G to make sure that the value sent down 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. 0!"#$%&'()*+,-./01234567rstuvwxyz{|}~" QOptions for barrier creation; a function to show the inner data, and an optional S label (both only affect tracing). These options can be passed to newPhasedBarrier'. Added in version 1.7.0. Aside from the standard  , you can use succ or (+1) with M Integer as the inner type to get a barrier that never cycles. You can also K do things like supplying (+2) as the incrementing function, or even using - lists as the phase type to do crazy things. Added in version 2.1.0. See 1Control.Concurrent.CHP.Channels.Creation.ChanOpts. ;A useful type synonym for enrolled barriers with no phases Added in 1.1.0 FA special case of the PhasedBarrier that has no useful phases, i.e. a  standard barrier. 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. -Finds out the current phase a barrier is on. FIf the barrier is not in the given phase, synchronises on the barrier  repeatedly until it is in the given phase. KSynchronises on the barrier at least once, until it is in the given phase.  Note that AsyncAndWaitForPhase ph bar == syncBarrier bar >> waitForPhase ph  bar. Added in version 1.7.0. EThe default phase incrementing function. If the phase is already at ,  it sets it to ; otherwise it uses  to increment the phase. The default: don't show anything, don')t label anything, use Enum+Bounded+Eq to  work out the phase increment. Added in version 1.7.0. LUses the Show instance for showing the data in traces, and the given label. Added in version 1.7.0. 1Creates a new barrier with no processes enrolled ICreates a new barrier with no processes enrolled and the given priority. Added in version 2.1.0. FCreates 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 /The Show constraint was added in version 1.5.0 Like * but allows you to customise the options. ICreates a new barrier with no processes enrolled and labels it in traces  using the given label. See . HGets the identifier of a Barrier. Useful if you want to identify it in  the trace later on. qqCThe writing end of a reduce channel. You must enroll on it before $ you can read from it or poison it. ,The Eq instance was added in version 1.4.0. %The reading end of a reduce channel. ,The Eq instance was added in version 1.4.0. ,The Eq instance was added in version 1.4.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. (The writing end of a broadcast channel. ,The Eq instance was added in version 1.4.0. FThe reading end of a broadcast channel. You must enroll on it before $ you can read from it or poison it. ,The Eq instance was added in version 1.4.0. ,The Eq instance was added in version 1.4.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. Added in version 1.5.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. Added in version 1.5.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. +The reduce channel version of sameChannel. *This function was added in version 1.4.0. Added in version 1.5.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. Added in version 1.5.0. SIn versions 1.5.0-1.7.0, the broadcast and reduce channels do not appear correctly  in the traces. JA clock that measures time using the given type. Only Ord is required on Q the type, so it can be all sorts. Obvious possibilities are numeric types such E as Int and Double -- if you want monotonically-increasing time, see . Q Other possibilities include your own algebraic types, if you want a clock that N cycles around a given set of phases. If every process enrolled on the clock G always just waits for the next time, you may want to consider using a q. N If you want a clock that works in reverse or anything else strange, you can C always wrap your type in a newtype to give a custom Ord instance. NSee the documentation at the beginning of this module for more information on  clocks. ;A type-class for things that you can on for a specific time/ phase. The  instance for q. repeatedly syncs until the specific phase is 2 reached. Clock waits until the time is reached. 3Given an enrolled item, waits for the specific time/ phase (if 2 you pass a Just value) or the next available time/phase. (if you H pass Nothing). The value returned is the new current time. Note that  waiting for the current time/phase or a past time/ phase on a  clock/ barrier will not0 return immediately -- see the rules at the top  of this module, and see . Gets the current time/phase. ONormally, when waiting on a clock, if you wait for a time equal to (or earlier R than) the current time, you will block until the clock wraps around. Sometimes, O however, you may want your clock to never wrap around (and use Integer as the M inner type, usually), and want to make sure that if a process waits for the V current time or earlier, it returns instantly. That is what this function achieves. GCalling this function with Nothing has indentical behaviour to calling  N with Nothing. If you wait for the current time or earlier, all of the other O processes waiting on the clock will remain blocked. Processes who have asked P to wait for the current time will remain blocked -- it is generally not useful  to mix  and  on the same clock. LCreates a clock that starts at the given time. The Show instance is needed  to display times in traces. FCreates a clock that starts at the given time, and gives it the given K label in traces. The Show instance is needed to display times in traces. DAn alt between several actions, with arbitrary priority. The first J available action is chosen (with an arbitrary choice if many actions are D available at the same time), 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 (</>) CSince version 2.2.0, this operator is deprecated in favour of the ( | ) operator " from the Alternative type-class. LRuns all the given processes in parallel with each other, but only when the 0 choice at the beginning of each item is ready. So for example, if you do:  M every [ readChannel c >>= writeChannel d, readChannel e >>= writeChannel f] OThis will forward values from c and e to d and f respectively in parallel, but T only once both channels c and e are ready to be read from. So f cannot be written C to before c is read from (contrast this with what would happen if  were  replaced with R). +This behaviour can be somewhat useful, but  is much more powerful when  used as part of an . This code:  - alt [ every [ readChannel c, readChannel d] 5 , every [ writeChannel e 6, writeChannel f 8] ] MWaits to either read from channels c and d, or to write to channels e and f. 0The events involved can partially overlap, e.g.  - alt [ every [ readChannel a, readChannel b] 2 , every [ readChannel a, writeChannel c 6] ] QThis will wait to either read from channels a and b, or to read from a and write T to c, whichever combination is ready first. If both are ready, the choice between = them will be arbitrary (just as with any other choices; see  for more details). 5The sets can even be subsets of each other, such as:  - alt [ every [ readChannel a, readChannel b] > , every [ readChannel a, readChannel b, readChannel b] ] MIn this case there are no guarantees as to which choice will happen. Do not K assume it will be the smaller, and do not assume it will be the larger. QBe wary of what happens if a single event is included multiple times in the same , as F this may not do what you expect (with or without choice). Consider:  + every [ readChannel c >> writeChannel d 6 - , readChannel c >> writeChannel d 8 ] NWhat will happen is that the excecution will wait to read from c, but then it P will execute only one of the bodies (an arbitrary choice). In general, do not O rely on this behaviour, and instead try to avoid having the same events in an  >. Also note that if you synchronise on a barrier twice in an , M this will only count as one member enrolling, even if you have two enrolled  ends! For such a use, look at R instead. IAlso note that this currently applies to both ends of channels, so that:  + every [ readChannel c, writeChannel c 2 ] CWill block indefinitely, rather than completing the communication.  Each item " must support choice (and in fact ) only a subset of the items supported by  are supported by ). Currently the items  in the list passed to  must be one of the following:  A call to +Control.Concurrent.CHP.Channels.readChannel (or .Control.Concurrent.CHP.Channels.extReadChannel).  A call to ,Control.Concurrent.CHP.Channels.writeChannel (or /Control.Concurrent.CHP.Channels.extWriteChannel).  e, the always-ready guard.  !Control.Concurrent.CHP.Monad.stop., the never-ready guard (will cause the whole  to never be ready,  since  has to wait for all guards).  A call to (Control.Concurrent.CHP.Monad.syncBarrier. L A sequential composition where the first item is one of the things in this  list.  A call to  (you can nest  blocks inside each other). Timeouts (e.g. $Control.Concurrent.CHP.Monad.waitFor;) are currently not supported. You can always get another M process to synchronise on an event with you once a certain time has passed. !Note also that you cannot put an  inside an . So you cannot say:   every [ readChannel c 0 , alt [ readChannel d, readChannel e ] ] NTo wait for c and (d or e) like this you must expand it out into (c and d) or  (c and e):  - alt [ every [ readChannel c, readChannel d] / , every [ readChannel c, readChannel e] ] 2As long as x meets the conditions laid out above,  [x] will have the same  behaviour as x. Added in version 1.1.0 Like  but discards the results. Added in version 1.8.0. !A useful operator that acts like #. The operator is associative and  commutative (see : for notes on idempotence). When you have lots of things  to join with this operator, it's probably easier to use the  function. Added in version 1.1.0  !"#$%&'()*+,-./01234567QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFFGHIJKLMNOPQRSTUVW X X Y Z [ \ \ ] ^ _ ` a b c d e e f g hijk l m n o p q r s t uvwxyz{|}~            !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK0LMMNOPQRSTUVWXYZ[\]^_`abcdefghhijklmnopqrstuvvwxyz{|}~8@DEV           chp-2.2.0$Control.Concurrent.CHP.Channels.EndsControl.Concurrent.CHP.TracesControl.Concurrent.CHP.MonadControl.Concurrent.CHP.EnrollControl.Concurrent.CHP.Alt(Control.Concurrent.CHP.Channels.CreationControl.Concurrent.CHP.Channels&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.Barriers(Control.Concurrent.CHP.Channels.Synonyms-Control.Concurrent.CHP.Channels.Communication/Control.Concurrent.CHP.Channels.BroadcastReduceControl.Concurrent.CHP.Clocks Control.Concurrent.CHP.ProcessIdControl.Concurrent.CHP.MutexControl.Concurrent.CHP.Poison Control.Concurrent.CHP.EventTypeControl.Concurrent.CHP.EventMapControl.Concurrent.CHP.EventSetControl.Concurrent.CHP.Event"Control.Concurrent.CHP.Traces.BaseControl.Concurrent.CHP.GuardControl.Concurrent.CHP.Base$Control.Concurrent.CHP.Channels.BaseControl.Concurrent.CHP.CSPControl.Concurrent.CHPSharedRecordedEventType ClockSync BarrierSync ChannelComm ChannelLabelsRecordedIndivEventClockSyncIndivBarrierSyncIndiv ChannelRead ChannelWrite RecordedEventrecordedIndivEventLabelrecordedIndivEventSeq PoisonablepoisoncheckForPoisonTracerunCHPAndTrace emptyTrace prettyPrintlabelAllMonadCHPliftCHPCHPEnrolled liftIO_CHP throwPoison onPoisonTraponPoisonRethrow poisonAllpriAltstopChangetChannelIdentifierreaderwriterChanoutChaninChanOptschanOptsPriority chanOptsShow chanOptsLabelChannel newChannel' sameChanneldefaultChanOpts chanLabel newChannel newChannelRW newChannelWRnewChannelListnewChannelListWithStemnewChannelListWithLabels labelChannelTraceOffrunCHP_TraceOffCSPTrace getCSPPlainrunCHP_CSPTracerunCHP_CSPTraceAndPrintStructuralTraceEventHierarchyStructuralParallelStructuralSequence SingleEventgetAllEventsInHierarchygetStructuralPlainrunCHP_StructuralTracerunCHP_StructuralTraceAndPrintVCRTrace getVCRPlainrunCHP_VCRTracerunCHP_VCRTraceAndPrintvcrToCSPstructuralToVCRstructuralToCSPForkingT runParallel runParMapM runParMapM_<||><|*|> runParallel_ liftForkingforkingforkrunCHPrunCHP_foreverPprocess subProcessembedCHP embedCHP_ embedCHP1 embedCHP1_waitForskip liftIO_CHP' Enrollableenrollresign furtherEnroll enrollPair enrollList enrollAll enrollAllT enrollOneMany enrollAll_ PhasedBarrierreaderswritersclaimAnyToAnyChannelOneToAnyChannelAnyToOneChannelOneToOneChanneloneToOneChanneloneToOneChannel'anyToOneChanneloneToAnyChannelanyToAnyChannelanyToOneChannel'oneToAnyChannel'anyToAnyChannel'WriteableChannel writeChannelextWriteChannelextWriteChannel'ReadableChannel readChannelextReadChannel writeValuewriteChannelStrictBarOpts barIncPhase barPriority barOptsShow barOptsLabelEnrolledBarrierBarrier syncBarrier currentPhase waitForPhasesyncAndWaitForPhasedefaultIncPhasedefaultBarOptsbarLabel newBarrier newBarrierPrinewPhasedBarriernewPhasedBarrier'newBarrierWithLabelgetBarrierIdentifierManyToAnyChannelManyToOneChannel ReduceChanout ReduceChaninAnyToManyChannelOneToManyChannelBroadcastChanoutBroadcastChaninoneToManyChannelanyToManyChanneloneToManyChannel'anyToManyChannel'sameReduceChannelmanyToOneChannelmanyToAnyChannelmanyToOneChannel'manyToAnyChannel'ClockWaitablewaitgetCurrentTime waitUnboundednewClocknewClockWithLabelalt<->everyevery_<&> ProcessId ProcessIdPartParSeq rootProcessIdemptyProcessId testProcessIdpidLessThanOrEqualMutex claimMutexnewMutex releaseMutex WithPoisonNoPoison PoisonItemmergeWithPoisonwaitForOrPoison flipMaybeOfferSet signalVarthreadId processId offersSetOffer signalValue offerAction eventsSet SignalVar SignalValueSignalEventgetEventUniquegetEventPriority getEventType getEventTVar OfferSetSetEventSetEventMapgetEventTypeValnewEvent newEventPri addPoisonnullSignalValue isNullSignal makeOfferSetListMapempty unionWith unionWithMkeysSettoListinsertminViewWithKeyvaluesListSetdelete deleteOrFailmemberunion intersectionfromListtoMapbaseGHC.ListnullWithPoisonMaybeTWPMTrunWPMT SearchResult TrimmedOffer pristineOffer trimmedEvents CurOfferSet ResigningOldNew SearchStateSSvisited notVisited OfferSetMap DiscoverM addResult checkEvent addFilter getOfferseventMapallEventsInOffergetAndIncCounter combineSearchliftWPMT backtracksearch searchWithsearchOfferSetsearchOriginalOfferSet processNextdiscoverAndResolvenewEventUnique enrollEvent resignEvent retractOffersretractOfferSet makeOffer makeAllOffers enableEvents disableEventscheckEventForPoison poisonEvent StructuredRevSeqParStrEvent SubTraceStore VCRTraceRev CSPTraceRev Hierarchy TraceStoreNoTraceLabelM runLabelM RecEventsindivRec indivRecJust labelWithgetName nameEvent nameEvent'nameIndivEventnameIndivEvent' mapSubTracerecordEventLast prependVCR recordEventmergeSubProcessTracesshouldMakeNewSetVCRcompress addParEventsH addSeqEventHaddRLE labelEvent labelUniquenewIds blankTraceschp_permutationsbagsEq EventActions actWhenLast actAlwaysGuard EventGuard StopGuard SkipGuard TimeoutGuard skipGuard isSkipGuardbadGuard stopGuard isStopGuard guardWaitFor ManyToOneTVarmtoIsFinalValuemtoResetmtoIntermtoFinalCHP'StandardAltableReturnPoisonT runPoisonT makeAltable makeAltable'pullOutStandard wrapPoison checkPoison liftPoisongetTraceliftSTM getProcessId wrapProcessrunCHPProgramWithrunCHPProgramWith'newManyToOneTVarwriteManyToOneTVarreadManyToOneTVarresetManyToOneTVar&>>=selectFromGuards waitAlting makeLookup eventGuardswaitNormalGuardspriAlt' STMChannelSTMChan stmChannel consumeData sharedErrorsendData consumeAcksendAckstartReadChannelCendReadChannelC readChannelC poisonReadCcheckPoisonReadCstartWriteChannelCsendWriteChannelCendWriteChannelC writeChannelC poisonWriteCcheckPoisonWriteCchantoPublicnameVCRnameVCR'ContContDonecombine participantssinglemakeContmergePartoVCRflattenStructuralForking runForkingTGHC.BasemaprunParallelPoison Control.MonadforeverGHC.EnumEnumBounded GHC.ClassesEq integer-gmpGHC.Integer.TypeIntegerbuildOnEventPoison scopeBlock wrapIndivsyncBarrierWith repeatUntilmaxBoundminBoundsuccnewBarrierEventGOGI ReduceChannelGCBOBIBroadcastChannelBCnewBroadcastChannelnewReduceChannel TimerDatacurTimeseqTimeenrolledOnTimerofferedOnTimertimerOffersNexttimerOffersBeforetimerOffersAftertimerEventPoolTimeVar modifyTVar modifyTVar' poisonTVaremptyTimerDataenrollTimerDataresignTimerDatapoisonTimerData spareEventofferTimerDatacheckCompletion waitClock