úÎu\o¾G      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF  TrustworthyGHIJKLMNOPQRSTUV GILMNOPQRSGHIJKLMNOPQRSTUVnon-portable (requires STM) experimentallibraries@haskell.org Trustworthy : is an abstract type representing a bounded FIFO channel. $Build and returns a new instance of  IO version of ). This is useful for creating top-level  s using   , because using    inside    isn't  possible. Write a value to a ; blocks if the queue is full. Read the next value from the .  A version of " which does not retry. Instead it  returns Nothing if no value is available. Get the next value from the TBQueue without removing it, # retrying if the channel is empty.  A version of " which does not retry. Instead it  returns Nothing if no value is available. JPut a data item back onto a channel, where it will be the next item read.  Blocks if the queue is full. Returns W if the supplied  is empty. X.maximum number of elements the queue can hold Y   XYnon-portable (requires STM) experimentallibraries@haskell.org Trustworthy = is an abstract type representing an unbounded FIFO channel. $Build and returns a new instance of  IO version of ). This is useful for creating top-level  s using   , because using    inside    isn't  possible. Write a value to a . Read the next value from the .  A version of " which does not retry. Instead it  returns Nothing if no value is available. Get the next value from the TQueue without removing it, # retrying if the channel is empty.  A version of " which does not retry. Instead it  returns Nothing if no value is available. !JPut a data item back onto a channel, where it will be the next item read. "Returns W if the supplied  is empty. Z !"[  !"  !" Z !"[non-portable (requires STM) experimentallibraries@haskell.org Trustworthy##= is an abstract type representing an unbounded FIFO channel. $#Build and return a new instance of # %IO version of $). This is useful for creating top-level  #s using   , because using    inside    isn't  possible. &Create a write-only #. More precisely, ) will   J even after items have been written to the channel. The only way to read - a broadcast channel is to duplicate it with -. 7Consider a server that broadcasts messages to clients:  ,serve :: TChan Message -> Client -> IO loop  serve broadcastChan client = do % myChan <- dupTChan broadcastChan  forever $ do $ message <- readTChan myChan  send client message The problem with using $, to create the broadcast channel is that if I it is only written to and never read, items will pile up in memory. By  using &/ to create the broadcast channel, items can be 1 garbage collected after clients have seen them. 'IO version of &. (Write a value to a #. )Read the next value from the #. * A version of )" which does not retry. Instead it  returns Nothing if no value is available. +Get the next value from the TChan without removing it, # retrying if the channel is empty. , A version of +" which does not retry. Instead it  returns Nothing if no value is available. - Duplicate a #:: the duplicate channel begins empty, but data written to N either channel from then on will be available from both. Hence this creates F a kind of broadcast channel, where data written by anyone is seen by  everyone else. .JPut a data item back onto a channel, where it will be the next item read. /Returns W if the supplied # is empty. 0Clone a #>: similar to dupTChan, but the cloned channel starts with the 1 same content available as the original channel. \]^_#`$%&'()*+,-./0#$%&'()*+,-./0#$%&'-)*+,(./0\^]_#`$%&'()*+,-./0non-portable (requires STM) experimentallibraries@haskell.org Trustworthy 1A 1# is a synchronising variable, used Dfor communication between concurrent threads. It can be thought of &as a box, which may be empty or full. 2 Create a 1$ which contains the supplied value. 3IO version of 2). This is useful for creating top-level  1s using   , because using    inside    isn't  possible. 4 Create a 1 which is initially empty. 5IO version of 4). This is useful for creating top-level  1s using   , because using    inside    isn't  possible. 6Return the contents of the 1 . If the 1 is currently  empty, the transaction will   . After a 6,  the 1 is left empty. 7 A version of 6 that does not  . The 7  function returns a if the 1 was empty, or b a if  the 1 was full with contents a . After 7, the  1 is left empty. 8Put a value into a 1 . If the 1 is currently full,  8 will  . 9 A version of 8 that does not  . The 9 $ function attempts to put the value a into the 1 , returning  W if it was successful, or c otherwise. :This is a combination of 6 and 8 ; ie. it  takes the value from the 1!, puts it back, and also returns  it. ; A version of :" which does not retry. Instead it  returns Nothing if no value is available. <Swap the contents of a 1 for a new value. =Check whether a given 1 is empty. 1d23456789:;<= 123456789:;<= 1243568:;<79= 1d23456789:;<=non-portable (requires STM) experimentallibraries@haskell.org Trustworthy>Mutate the contents of a . N.B., this version is  non-strict. ?Strict version of >. @Swap the contents of a  for a new value. >?@ >?@ >?@>?@non-portable (requires STM) experimentallibraries@haskell.org TrustworthyA6TArray is a transactional array, supporting the usual e  interface for mutable arrays. It is currently implemented as Array ix (TVar e), I but it may be replaced by a more efficient implementation in the future 0 (the interface will remain the same, however). fLike  replicateM5 but uses an accumulator to prevent stack overflows.  Unlike  replicateM) the returned list is in reversed order.  This doesn';t matter though since this function is only used to create ! arrays with identical elements. AgfhAAAgfhnon-portable (requires STM) experimentallibraries@haskell.org TrustworthyijBkl  B  B ijBkl non-portable (requires STM) experimentallibraries@haskell.org TrustworthyC  !"#$%&'()*+,-./0123456789:;<=>?@ABnon-portable (requires STM) experimentallibraries@haskell.org Safe-InferredCC: is a transactional semaphore. It holds a certain number 4 of units, and units may be acquired or released by E and  F respectively. When the C is empty, E  blocks.  Note that C- has no concept of fairness, and there is no # guarantee that threads blocked in E will be unblocked in E the same order; in fact they will all be unblocked at the same time  and will fight over the C . Hence C is not suitable if D you expect there to be a high number of threads contending for the 2 resource. However, like other STM abstractions, C is  composable. CmDEFCDEFCDEFCmDEFn                !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV     W         X Y Z[\]^)_`abc3 de df[\gAhijkQlmmnoSp stm-2.4.2Control.Concurrent.STM.TVarControl.Monad.STMControl.Concurrent.STM.TBQueueControl.Concurrent.STM.TQueueControl.Concurrent.STM.TChanControl.Concurrent.STM.TMVarControl.Concurrent.STM.TArrayControl.Concurrent.STM.TSemControl.Sequential.STMSystem.IO.UnsafeunsafePerformIOControl.Concurrent.STMbase GHC.Conc.IO registerDelay GHC.Conc.Sync writeTVarreadTVar readTVarIO newTVarIOnewTVaralwaysalwaysSucceedscatchSTMthrowSTMorElseretry atomicallySTMTVarTBQueue newTBQueue newTBQueueIO writeTBQueue readTBQueuetryReadTBQueue peekTBQueuetryPeekTBQueue unGetTBQueueisEmptyTBQueueTQueue newTQueue newTQueueIO writeTQueue readTQueue tryReadTQueue peekTQueue tryPeekTQueue unGetTQueue isEmptyTQueueTChannewTChan newTChanIOnewBroadcastTChannewBroadcastTChanIO writeTChan readTChan tryReadTChan peekTChan tryPeekTChandupTChan unGetTChan isEmptyTChan cloneTChanTMVarnewTMVar newTMVarIO newEmptyTMVarnewEmptyTMVarIO takeTMVar tryTakeTMVarputTMVar tryPutTMVar readTMVar tryReadTMVar swapTMVar isEmptyTMVar modifyTVar modifyTVar'swapTVarTArraycheckTSemnewTSemwaitTSem signalTSemunSTM $fMonadSTM$fApplicativeSTM $fFunctorSTMghc-prim GHC.TypesTrue $fEqTBQueue $fEqTQueueTListTConsTNilTVarList Data.MaybeNothingJustFalse array-0.4.0.1Data.Array.BaseMArrayrep$fMArrayTArrayeSTMSTMretliftSTM $fMonadFixSTM