úÎC•A’     Safe@Read-only array. Existential quantification is used to hide the  w1 type parameter. This means that it can escape a  C context, and can be read in the enclosing context. However, it is < impossible for anyone to write to the array outside of the  ) context in which the array was created. Mutable array. " is actually just a newtype of an   , but the r and w$ type parameters allow the read and 6 write dependencies to be tracked by the type system. Mutable reference. " is actually just a newtype of an   , but the r and w$ type parameters allow the read and 6 write dependencies to be tracked by the type system. 0 is semantically equivalent to readOnlyST2, but  uses a newtype to package the forall. Sometimes this packaging is ) convenient when passing a value of type  as an 2 argument because it avoids the need for a nested forall in the  type signature. 3 is semantically equivalent to pureST2, but uses a  newtype to package the forall. Sometimes this packaging is ) convenient when passing a value of type  as an argument ) because it avoids the need for a nested forall in the type  signature. The   monad is a newtype of  . The type parameters r and  w> are phantom type parameters which are used to track the read , and write dependencies of the computation. @This function checks that the sub-computation is polymorphic in D both type parameters. This means that the sub-computation does not 5 read or write any state from the enclosing context. @This function checks that the sub-computation is polymorphic in  the w: type parameter. This means that the sub-computation does ? not write any state from the enclosing context (but read-only  operations are permitted).  " computations can be converted to   computations, but ) only with a monomorphic type signature.  " computations can be converted to   computations, but ) only with a monomorphic type signature. Create a new reference. The r and w type parameters of the  reference are unified with the   monad to indicate that new , state is created in the enclosing context. Read a reference. The w( type parameter of the reference is not  unified with the  ' monad to indicate that this access is  read-only. Write to a reference. The w$ type parameter of the reference is  unified with the  , monad to indicate that state is written in  the enclosing context. Modify a reference. Convert an IORef to an ST2Ref. Convert an ST2Ref to an IORef. 'Create an array with an initial value. Create an uninitialised array.  Read an index of the array. The w type parameter of the # reference is not unified with the   monad to indicate that this  access is read-only. !Write an index of the array. The w type parameter of the array  is unified with the  ) monad to indicate that state is written  in the enclosing context. CRead the size of the array. Neither type parameter is unified with  the  1 monad because the array itself is not accessed.  (Conceptually, an # is a pair, consisting of the size A information and the array. This function only accesses the size # information, which is immutable.) #Convert an IOArray to an ST2Array. #Convert an ST2Array to an IOArray. <Create a read-only array. It is important to note that this % function does not make the original  immutable. It merely C creates a read-only reference to the original array. However, the   can be returned through a   or  7 context and the typing rules ensure that the original  # cannot be modified outside of the  context 7 in which it was created. In other words, the original  ' can continue to be modified after the  is created, but  only until the  is returned through a   context. &Read an index of the read-only array. BSpawn one thread for each index in the range and wait for all the E threads to finish. Each thread is parameterised by its index, which  is an element of the range. $!"# $% &    !"# $% &'      !"#$% &'(Control-Monad-ST2-0.1.0.1Control.Monad.ST2 ST2RArrayST2ArrayST2Ref ReadOnlyST2runReadOnlyST2PureST2 runPureST2ST2pureST2 readOnlyST2ioToST2st2ToIO newST2Ref readST2Ref writeST2Ref modifyST2Ref importST2Ref exportST2Ref newST2Array newST2Array_ readST2Array writeST2ArrayboundsST2ArrayimportST2ArrayexportST2Array mkST2RArray readST2RArray parallelST2base GHC.IOArrayIOArray GHC.IORefIORefghc-prim GHC.TypesIO unwrapST2 $fMonadST2