~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}  (c) Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone;~ (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone;"  !"#$"  !"#$"$#"!  "  !"#$  (c) Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone ;(c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone 234;=K %8Class of primitive monads for state-transformer actions.Unlike '#, this typeclass requires that the Monadp be fully expressed as a state transformer, therefore disallowing other monad transformers on top of the base IO or ST.&*Expose the internal structure of the monad'EClass of monads which can perform primitive state-transformer actions(State token type)Execute a primitive operation*,Execute a primitive operation with no result+Lifts a % into another ', with the same underlying state token type., Convert a %, to another monad with the same state token.- Convert a % with a  state token to . Convert a % to / Convert a %Z to another monad with a possibly different state token. This operation is highly unsafe!0 Convert any % to A with an arbitrary state token. This operation is highly unsafe!1 Convert any % to ". This operation is highly unsafe! %&'()*+,-./012345%&'()*+,-./012345'()*%&+,-./102345%&'()*+,-./012345 (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+; 64Class of types supporting primitive array operations7Size of values of type a. The argument is not used.8Alignment of values of type a. The argument is not used.9@Read a value from the array. The offset is in elements of type a rather than in bytes.:HRead a value from the mutable array. The offset is in elements of type a rather than in bytes.;GWrite a value to the mutable array. The offset is in elements of type a rather than in bytes.<lFill a slice of the mutable array with a value. The offset and length of the chunk are in elements of type a rather than in bytes.=Read a value from a memory position given by an address and an offset. The memory block the address refers to must be immutable. The offset is in elements of type a rather than in bytes.>jRead a value from a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.?iWrite a value to a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.@pFill a memory block given by an address, an offset and a length. The offset and length are in elements of type a rather than in bytes.AA machine address6789:;<=>?@AB 6789:;<=>?@AB 6789:;<=>?@AB6 789:;<=>?@AB (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+;C=Mutable boxed arrays associated with a primitive state token.E Boxed arraysGcCreate a new mutable array of the specified size and initialise all elements with the given value.H/Read a value from the array at the given index.I.Write a value to the array at the given index.J9Read a value from the immutable array at the given index.K Monadically read a value from the immutable array at the given index. This allows us to be strict in the array while remaining lazy in the read element which is very useful for collective operations. Suppose we want to copy an array. We could do something like this: ucopy marr arr ... = do ... writeArray marr i (indexArray arr i) ... ...2But since primitive arrays are lazy, the calls to J! will not be evaluated. Rather, marrG will be filled with thunks each of which would retain a reference to arr&. This is definitely not what we want!With K, we can instead write copy marr arr ... = do ... x <- indexArrayM arr i writeArray marr i x ...\Now, indexing is executed immediately although the returned element is still not evaluated.LtConvert a mutable array to an immutable one without copying. The array should not be modified after the conversion.M{Convert an immutable array to an mutable one without copying. The immutable array should not be used after the conversion.N<Check whether the two arrays refer to the same memory block.O6Copy a slice of an immutable array to a mutable array.PVCopy a slice of a mutable array to another array. The two arrays may not be the same.QReturn a newly allocated Array with the specified subrange of the provided Array. The provided Array should contain the full subrange specified by the two Ints, but this is not checked.RReturn a newly allocated MutableArray. with the specified subrange of the provided MutableArray. The provided MutableArray should contain the full subrange specified by the two Ints, but this is not checked.CDEFGHIJKLMNOdestination arrayoffset into destination array source arrayoffset into source arraynumber of elements to copyPdestination arrayoffset into destination array source arrayoffset into source arraynumber of elements to copyQ source arrayoffset into destination arraynumber of elements to copyR source arrayoffset into destination arraynumber of elements to copyCDEFGHIJKLMNOPQREFCDGHIJKLMNOPQRCDEFGHIJKLMNOPQR (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone +;S;Mutable byte arrays associated with a primitive state tokenU Byte arraysW6Create a new mutable byte array of the specified size.X Create a pinnedW byte array of the specified size. The garbage collector is guaranteed not to move it.Y Create a pinneds byte array of the specified size and with the give alignment. The garbage collector is guaranteed not to move it.ZEYield a pointer to the array's data. This operation is only safe on pinned byte arrays allocated by X or Y.[EYield a pointer to the array's data. This operation is only safe on pinned byte arrays allocated by X or Y.\7Check if the two arrays refer to the same memory block.]yConvert a mutable byte array to an immutable one without copying. The array should not be modified after the conversion.^~Convert an immutable byte array to a mutable one without copying. The original array should not be used after the conversion._Size of the byte array.`Size of the mutable byte array.aURead a primitive value from the byte array. The offset is given in elements of type a rather than in bytes.bURead a primitive value from the byte array. The offset is given in elements of type a rather than in bytes.cTWrite a primitive value to the byte array. The offset is given in elements of type a rather than in bytes.d@Copy a slice of an immutable byte array to a mutable byte array.eYCopy a slice of a mutable byte array into another array. The two slices may not overlap.fRCopy a slice of a mutable byte array into another, potentially overlapping array.ghFill a slice of a mutable byte array with a value. The offset and length are given in elements of type a rather than in bytes.h1Fill a slice of a mutable byte array with a byte.STUVWXYZ[\]^_`abcddestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copyedestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copyfdestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copyg array to filloffset into arraynumber of values to fillvalue to fill withh array to filloffset into arraynumber of bytes to fillbyte to fill withSTUVWXYZ[\]^_`abcdefghUVSTWXYbca]^defgh_`\Z[STUVWXYZ[\]^_`abcdefgh (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone; iThe null addressj.Offset an address by the given number of bytesk`Distance in bytes between two addresses. The result is only valid if the difference fits in an .l-The remainder of the address and the integer.mRead a value from a memory position given by an address and an offset. The memory block the address refers to must be immutable. The offset is in elements of type a rather than in bytes.njRead a value from a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.oiWrite a value to a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.p/Copy the given number of bytes from the second A* to the first. The areas may not overlap.q/Copy the given number of bytes from the second A& to the first. The areas may overlap.rPFill a memory block of with the given value. The length is in elements of type a rather than in bytes. ijklmnopdestination addresssource addressnumber of bytesqdestination addresssource addressnumber of bytesr ABijklmnopqr ABijklmnopqr ijklmnopqrjkl (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone;sSize of values of type a. The argument is not used.tAlignment of values of type a. The argument is not used.stA6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrststst4(c) Justin Bonnar 2011, Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+;uA uV behaves like a single-element mutable array associated with a primitive state token.w Create a new u! with the specified initial valuexRead the value of a uyWrite a new value into a uz$Atomically mutate the contents of a u{Strict version of z,. This forces both the value stored in the u as well as the value returned.|Mutate the contents of a u}Strict version of | uvwxyz{|} uvwxyz{|} uvwxyz{|} uvwxyz{|}    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOOPPQRSTUVWXYZ[\]]^^_`abcdefghijklmnopqrstuvwxyz{|}}~   primitive-0.6Data.Primitive.ByteArrayControl.Monad.PrimitiveData.Primitive.MachDepsData.Primitive.TypesData.Primitive.ArrayData.Primitive.AddrData.PrimitiveData.Primitive.MutVarData.Primitive.Internal.Compat"Data.Primitive.Internal.Operationsghc-primGHC.Prim ByteArray#MutableByteArray# RealWorldInt64_#Word64_# sIZEOF_CHARaLIGNMENT_CHAR sIZEOF_INT aLIGNMENT_INT sIZEOF_WORDaLIGNMENT_WORD sIZEOF_DOUBLEaLIGNMENT_DOUBLE sIZEOF_FLOATaLIGNMENT_FLOAT sIZEOF_PTR aLIGNMENT_PTR sIZEOF_FUNPTRaLIGNMENT_FUNPTRsIZEOF_STABLEPTRaLIGNMENT_STABLEPTR sIZEOF_INT8aLIGNMENT_INT8 sIZEOF_WORD8aLIGNMENT_WORD8 sIZEOF_INT16aLIGNMENT_INT16 sIZEOF_WORD16aLIGNMENT_WORD16 sIZEOF_INT32aLIGNMENT_INT32 sIZEOF_WORD32aLIGNMENT_WORD32 sIZEOF_INT64aLIGNMENT_INT64 sIZEOF_WORD64aLIGNMENT_WORD64PrimBaseinternal PrimMonad PrimState primitive primitive_liftPrim primToPrimprimToIOprimToSTunsafePrimToPrimunsafePrimToSTunsafePrimToIOunsafeInlinePrimunsafeInlineIOunsafeInlineSTtouchPrimsizeOf# alignment#indexByteArray#readByteArray#writeByteArray# setByteArray# indexOffAddr# readOffAddr# writeOffAddr# setOffAddr#Addr MutableArrayArraynewArray readArray writeArray indexArray indexArrayMunsafeFreezeArrayunsafeThawArraysameMutableArray copyArraycopyMutableArray cloneArraycloneMutableArrayMutableByteArray ByteArray newByteArraynewPinnedByteArraynewAlignedPinnedByteArraybyteArrayContentsmutableByteArrayContentssameMutableByteArrayunsafeFreezeByteArrayunsafeThawByteArraysizeofByteArraysizeofMutableByteArrayindexByteArray readByteArraywriteByteArray copyByteArraycopyMutableByteArray moveByteArray setByteArray fillByteArraynullAddrplusAddr minusAddrremAddr indexOffAddr readOffAddr writeOffAddrcopyAddrmoveAddrsetAddrsizeOf alignmentMutVar newMutVar readMutVar writeMutVaratomicModifyMutVaratomicModifyMutVar' modifyMutVar modifyMutVar'base Data.Data mkNoRepType GHC.TypesisTrue#setWideCharOffAddr#setDoubleOffAddr#setFloatOffAddr#setAddrOffAddr#setIntOffAddr#setInt64OffAddr#setInt32OffAddr#setInt16OffAddr#setInt8OffAddr#setWordOffAddr#setWord64OffAddr#setWord32OffAddr#setWord16OffAddr#setWord8OffAddr#setWideCharArray#setDoubleArray#setFloatArray# setAddrArray# setIntArray#setInt64Array#setInt32Array#setInt16Array# setInt8Array# setWordArray#setWord64Array#setWord32Array#setWord16Array#setWord8Array#IOGHC.STST $fPrimBaseST $fPrimMonadST$fPrimMonadRWST$fPrimMonadWriterT$fPrimMonadStateT$fPrimMonadRWST0$fPrimMonadWriterT0$fPrimMonadStateT0$fPrimMonadReaderT$fPrimMonadErrorT$fPrimMonadMaybeT$fPrimMonadListT$fPrimMonadIdentityT $fPrimBaseIO $fPrimMonadIOunI# $fPrimAddr $fPrimChar $fPrimDouble $fPrimFloat $fPrimInt64 $fPrimInt32 $fPrimInt16 $fPrimInt8 $fPrimInt $fPrimWord64 $fPrimWord32 $fPrimWord16 $fPrimWord8 $fPrimWord $fDataAddr $fOrdAddr$fEqAddr$fDataMutableArray $fDataArray memmove_mba$fDataMutableByteArray$fDataByteArrayInt $fEqMutVar