(|      !"#$%&'()*+,-./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;=K %+Class of primitive state-transformer monads&State token type'Execute a primitive operation(*Expose the internal structure of the monad),Execute a primitive operation with no result* 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!. Convert any % to A with an arbitrary state token. This operation is highly unsafe!/ Convert any % to ". This operation is highly unsafe!%&'()*+,-./0123%&'()*+,-./0123%&'()*+,-/.0123%&'()*+,-./0123 (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+; 44Class of types supporting primitive array operations5Size of values of type a. The argument is not used.6Alignment of values of type a. The argument is not used.7@Read a value from the array. The offset is in elements of type a rather than in bytes.8HRead a value from the mutable array. The offset is in elements of type a rather than in bytes.9GWrite 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.?A machine address456789:;<=>?@ 456789:;<=>?@ 456789:;<=>?@4 56789:;<=>?@ (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+;A=Mutable boxed arrays associated with a primitive state token.C Boxed arraysEcCreate a new mutable array of the specified size and initialise all elements with the given value.F/Read a value from the array at the given index.G.Write a value to the array at the given index.H9Read a value from the immutable array at the given index.I 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 H! 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 I, 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.JtConvert a mutable array to an immutable one without copying. The array should not be modified after the conversion.K{Convert an immutable array to an mutable one without copying. The immutable array should not be used after the conversion.L<Check whether the two arrays refer to the same memory block.M6Copy a slice of an immutable array to a mutable array.NVCopy a slice of a mutable array to another array. The two arrays may not be the same.OReturn 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.PReturn 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.ABCDEFGHIJKLMdestination arrayoffset into destination array source arrayoffset into source arraynumber of elements to copyNdestination arrayoffset into destination array source arrayoffset into source arraynumber of elements to copyO source arrayoffset into destination arraynumber of elements to copyP source arrayoffset into destination arraynumber of elements to copyABCDEFGHIJKLMNOPCDABEFGHIJKLMNOPABCDEFGHIJKLMNOP (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone +;Q;Mutable byte arrays associated with a primitive state tokenS Byte arraysU6Create a new mutable byte array of the specified size.V Create a pinnedW byte array of the specified size. The garbage collector is guaranteed not to move it.W Create a pinneds byte array of the specified size and with the give alignment. The garbage collector is guaranteed not to move it.XEYield a pointer to the array's data. This operation is only safe on pinned byte arrays allocated by V or W.YEYield a pointer to the array's data. This operation is only safe on pinned byte arrays allocated by V or W.Z7Check 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._URead a primitive value from the byte array. The offset is given in elements of type a rather than in bytes.`URead a primitive value from the byte array. The offset is given in elements of type a rather than in bytes.aTWrite a primitive value to the byte array. The offset is given in elements of type a rather than in bytes.b@Copy a slice of an immutable byte array to a mutable byte array.cYCopy a slice of a mutable byte array into another array. The two slices may not overlap.dRCopy a slice of a mutable byte array into another, potentially overlapping array.ehFill 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.f1Fill a slice of a mutable byte array with a byte.QRSTUVWXYZ[\]^_`abdestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copycdestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copyddestination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copye array to filloffset into arraynumber of values to fillvalue to fill withf array to filloffset into arraynumber of bytes to fillbyte to fill withQRSTUVWXYZ[\]^_`abcdefSTQRUVW`a_[\bcdef]^ZXYQRSTUVWXYZ[\]^_`abcdef (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone; gThe null addressh.Offset an address by the given number of bytesi`Distance in bytes between two addresses. The result is only valid if the difference fits in an .j-The remainder of the address and the integer.kRead 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.ljRead 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.miWrite 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.n/Copy the given number of bytes from the second ?* to the first. The areas may not overlap.o/Copy the given number of bytes from the second ?& to the first. The areas may overlap.pPFill a memory block of with the given value. The length is in elements of type a rather than in bytes. ghijklmndestination addresssource addressnumber of bytesodestination addresssource addressnumber of bytesp ?@ghijklmnop ?@ghijklmnop ghijklmnophij (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone;qSize of values of type a. The argument is not used.rAlignment of values of type a. The argument is not used.qrA456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrqrqr4(c) Justin Bonnar 2011, Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> non-portableNone+;sA sV behaves like a single-element mutable array associated with a primitive state token.u Create a new s! with the specified initial valuevRead the value of a swWrite a new value into a sx$Atomically mutate the contents of a syStrict version of x,. This forces both the value stored in the s as well as the value returned.zMutate the contents of a s{Strict version of z stuvwxyz{ stuvwxyz{ stuvwxyz{ stuvwxyz{    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLLMMNNOPQRSTUVWXYZ[[\\]^_`abcdefghijklmnopqrstuvwxyz{{|}~  primitive-0.5.4.0Data.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_WORD64 PrimMonad PrimState primitiveinternal primitive_ 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 $fPrimMonadST $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