!ypV      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.>FHISUVXI  primal-memoryJMutable region of memory which was allocated either as pinned or unpinned.=Constructor is not exported for safety. Violating type level 0 kind is very dangerous. Type safe constructor   and unwrapper  [ should be used instead. As a backdoor, of course, the actual constructor is available in Data.Prim.Memory.Internal' module and specially unsafe function  was crafted. primal-memoryOAn immutable region of memory which was allocated either as pinned or unpinned.=Constructor is not exported for safety. Violating type level 0 kind is very dangerous. Type safe constructor   and unwrapper  [ should be used instead. As a backdoor, of course, the actual constructor is available in Data.Prim.Memory.Internal' module and specially unsafe function  was crafted. primal-memoryDIn Haskell there is a distinction between pinned or unpinned memory.|Pinned memory is such, when allocated, it is guaranteed not to move throughout the lifetime of a program. In other words the address pointer that refers to allocated bytes will not change until it gets garbage collected because it is no longer referenced by anything. Unpinned memory on the other hand can be moved around during GC, which helps to reduce memory fragmentation.dPinned/unpinnned choice during allocation is a bit of a lie, because when attempt is made to allocate memory as unpinned, but requested size is a bit more than a certain threashold (somewhere around 3KiB) it might still be allocated as pinned. Because of that fact through out the "primal" universe there is a distinction between memory that is either ned or  onclusive.It is possible to use one of   or  to get a conclusive type." primal-memoryShrink mutable bytes to new specified count of elements. The new count must be less than or equal to the current count as reported by &.# primal-memory)Attempt to resize mutable bytes in place.:New bytes might be allocated, with the copy of an old one.@Old references should not be kept around to allow GC to claim it=Old references should not be used to avoid undefined behavior% primal-memoryHow many elements of type aU fits into bytes completely. In order to get a possible count of leftover bytes use  countRemBytes& primal-memoryHow many elements of type aO fits into bytes completely. In order to get any number of leftover bytes use  countRemBytes0 primal-memoryPointer access to immutable l should be for read only purposes, but it is not enforced. Any mutation will break referential transparency1 primal-memorySame as 02, but is suitable for actions that don't terminate primal-memoryDiscarding the B will trigger all if there are any associated Haskell finalizers.6 primal-memoryKCheck if two byte arrays refer to pinned memory and compare their pointers.7 primal-memory#Perform pointer equality on pinned . primal-memorySize in number of bytes primal-memorySize in number of bytes- primal-memoryChunk of memory to fill primal-memoryOffset in number of elements primal-memoryNumber of cells to fill primal-memoryA value to fill the cells with/ !"#$%&'()*+,-./012345678(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.=>?@AFHVXLt      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`9:;<=>?@ABCD 9?;=A:@<>BCD(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.FYEE primal-memoryMutable version of a G primal-memoryO(1) - Cast an immutable  to an immutable H primal-memoryO(1) - Cast an immutable  to an immutable  I primal-memoryO(1) - Cast an immutable   to an immutable J primal-memoryConvert  into a bytestring  K primal-memoryO(n) - Allocate " and fill them using the supplied  L primal-memoryO(n) - Allocate + and fill them with the contents of a lazy aM primal-memoryO(n) - Allocate - and fill them with the contents of a strict   8EFGHIJKLMNOEF JK GMLNO HI8(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone .=>?@AFX: P primal-memoryFFor memory allocated as pinned it is possible to operate on it with a :. Any data type that is backed by such memory can have a P3 instance. The simplest way is to convert it to a ( and other functions will come for free.Q primal-memory Convert to .R primal-memory"Apply an action to the raw memory  to which the data type point to. Type of data stored in memory is left ambiguous intentionaly, so that the user can choose how to treat the memory content.S primal-memory See this GHC  /https://gitlab.haskell.org/ghc/ghc/issues/18061 issue #180615 and related to get more insight why this is needed.T primal-memoryApply an action to the raw pointer. It is unsafe to return the actual pointer back from the action because memory itself might get garbage collected or cleaned up by finalizers.DIt is also important not to run non-terminating actions, because GHC can optimize away the logic that runs after the action and GC will happen before the action get's a chance to finish resulting in corrupt memory. Whenever you have an action that runs an infinite loop or ends in an exception throwing, make sure to use U instead.U primal-memorySame thing as T9 except it should be used for never ending actions. See S0 for more information on how this differes from T.V primal-memoryLifted version of b.W primal-memoryLifted version of c.X primal-memoryLifted version of d.Y primal-memoryLifted version of e.Z primal-memory Simila to f, except it operates on ^ , instead of Storable.[ primal-memory Similar to , except instead of Storable we use ^.\ primal-memory Just like [*, but memory is also aligned according to ^ instance] primal-memoryLifted version of g.^ primal-memoryLifted version of h._ primal-memoryLifted version of i` primal-memoryLifted version of ja primal-memory Similar to k, except instead of Storable we use ^ and we are not restricted to l), since finalizers are not possible with  PlaintPtrb primal-memory Similar to , except instead of Storable we use ^.c primal-memory Just like [*, but memory is also aligned according to ^ instanced primal-memoryLifted version of g.e primal-memoryLifted version of h.f primal-memoryUnlifted version of mg primal-memoryUnlifted version of nh primal-memoryLifted version of o.i primal-memoryAdvances the given address by the given offset in number of elemeents. This operation does not affect associated finalizers in any way.j primal-memoryzAdvances the given address by the given offset in bytes. This operation does not affect associated finalizers in any way.k primal-memorycFind the offset in bytes that is between the two pointers by subtracting one address from another.l primal-memoryFind the offset in number of elements that is between the two pointers by subtracting one address from another and dividing the result by the size of an element.m primal-memorySame as lA, but will also return the remainder in bytes that is left over.o primal-memory)Read-only access, but it is not enforced.q primal-memory)Read-only access, but it is not enforced.^ primal-memoryNumber of bytes to allocate primal-memoryAlignment in bytese primal-memoryNumber of bytes to allocate primal-memoryAlignment in bytes* 45PQRSTUVWXYZ[\]^_`abcdefghijklm*PQRSijlmkTUabcdehWYVZ[\]^_ X`fg45(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.=>?@AHISVXx} primal-memoryA wrapper that adds a phantom state token. It can be use with types that either doesn't have such state token or are designed to work in l and therefore restricted to _T. Using this wrapper is very much unsafe, so make sure you know what you are doing. primal-memory2Source and target can be overlapping memory chunks primal-memory2Source and target can be overlapping memory chunks primal-memory:Write the same value into each cell starting at an offset. primal-memory@Generalized memory allocation and pure/mutable state conversion. primal-memory7Source and target can't refer to the same memory chunks primal-memory7Source and target can't refer to the same memory chunks primal-memoryMake nG copies of supplied region of memory into a contiguous chunk of memory. primal-memoryChunk of empty memory. primal-memory.A region of memory that hold a single element. primal-memorygAllocate enough memory for number of elements. Memory is not initialized and may contain garbage. Use  if clean memory is needed.  Unsafe Count<Negative element count will result in unpredictable behavior primal-memorySame as , but also use memset+ to initialize all the new memory to zeros.  Unsafe Count<Negative element count will result in unpredictable behavior primal-memoryO(n)X - Convert a read-only memory region into a newly allocated other type of memory regionimport Data.ByteStringbs = pack [0x10 .. 0x20]bs>"\DLE\DC1\DC2\DC3\DC4\NAK\SYN\ETB\CAN\EM\SUB\ESC\FS\GS\RS\US "convertMem bs :: Bytes 'IncV[0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20] primal-memory}Figure out how many elements can fit into the region of memory. It is possible that there is a remainder of bytes left, see  for getting that too.Examples/b = fromListMem [0 .. 5 :: Word8] :: Bytes 'Pinb[0x00,0x01,0x02,0x03,0x04,0x05]countMem b :: Count Word16Count {unCount = 3}countMem b :: Count Word32Count {unCount = 1} primal-memory[Compute how many elements and a byte size remainder that can fit into the region of memory.Examples/b = fromListMem [0 .. 5 :: Word8] :: Bytes 'Pinb[0x00,0x01,0x02,0x03,0x04,0x05]countRemMem @Word16 b(Count {unCount = 3},0)countRemMem @Word32 b(Count {unCount = 1},2) primal-memory;Compare two regions of memory byte-by-byte. It will return p1 whenever both regions are exactly the same and q or r as soon as the first byte is reached that is less than or greater than respectfully in the first region when compared to the second one. It is safe for both regions to refer to the same part of memory, since this is a pure function and both regions of memory are read-only. primal-memoryIt is only guaranteed to convert the whole memory to a list whenever the size of allocated memory is exactly divisible by the size of the element, otherwise there will be some slack left unaccounted for. primal-memorySame as z, except if there is some slack at the end of the memory that didn't fit in a list it will be returned as a list of bytesExamplesimport Data.Word:set -XDataKinds0a = fromListMem [0 .. 10 :: Word8] :: Bytes 'Pina8[0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a]&toListSlackMem a :: ([Word8], [Word8])([0,1,2,3,4,5,6,7,8,9,10],[])'toListSlackMem a :: ([Word16], [Word8])([256,770,1284,1798,2312],[10])'toListSlackMem a :: ([Word32], [Word8])([50462976,117835012],[8,9,10])'toListSlackMem a :: ([Word64], [Word8])([506097522914230528],[8,9,10]) primal-memoryPRight fold that is useful for converting to list while tapping into list fusion. primal-memoryReturns pc if the full list did fit into the supplied memory chunk exactly. Otherwise it will return either q3 if the list was smaller than allocated memory or rG if the list was bigger than the available memory and did not fit into . primal-memoryJLoad a list of bytes into a newly allocated memory region. Equivalent to  for Examples%fromByteListMem [0..10] :: Bytes 'Pin8[0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a] primal-memory:Convert a memory region to a list of bytes. Equivalent to  for 5toByteListMem (fromByteListMem [0..10] :: Bytes 'Pin)[0,1,2,3,4,5,6,7,8,9,10] primal-memory.Map an index aware function over memory region0a = fromListMem [1 .. 10 :: Word8] :: Bytes 'Inca3[0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a]DimapMem (\i e -> (fromIntegral i :: Int8, e + 0xf0)) a :: Bytes 'Pine[0x00,0xf1,0x01,0xf2,0x02,0xf3,0x03,0xf4,0x04,0xf5,0x05,0xf6,0x06,0xf7,0x07,0xf8,0x08,0xf9,0x09,0xfa] primal-memoryIterate over a region of memory primal-memory A list of sq that covert bytes to base16 encoded strings. Each element of the list is a function that will convert one byte.,mb <- newPinnedMBytes (Count 5 :: Count Int)3mapM_ (\i -> writeOffMBytes mb (pred i) i) [1 .. 5]0foldr ($) "" . showsBytesHex <$> freezeMBytes mbR"01000000000000000200000000000000030000000000000004000000000000000500000000000000" primal-memoryDEnsure that memory is filled with zeros before and after it is used. primal-memoryIWritable memory. Must have enough bytes, at least: (off+count)*(sizeOf e) primal-memoryEAn offset into writable memory at which element setting should start. primal-memory'Numer of cells to write the elemnt into primal-memory\Element to write into all memory cells specified by offset and count. Even if the count is 0- this element might be still fully evaluated. primal-memorySource memory region primal-memory,Offset into the source in number of elements primal-memoryDestination memory region primal-memory-Offset into destination in number of elements primal-memoryNumber of elements to copy over primal-memorySource memory region primal-memory,Offset into the source in number of elements primal-memoryDestination memory region primal-memory-Offset into destination in number of elements primal-memoryNumber of elements to copy over primal-memoryRead-only memory type primal-memoryFirst region of memory primal-memory2Offset in number of elements into the first region primal-memorySecond region of memory primal-memory3Offset in number of elements into the second region primal-memoryNumber of elements to comparecstuvwxyz{|}~cstuvwxyz{|}~(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.=>?FHSUVXV& primal-memoryWrap t into  primal-memoryUnwrap  to get the underlying t. primal-memoryWrap u into  primal-memoryUnwrap  to get the underlying u. primal-memory<Check if two mutable bytes pointers refer to the same memory primal-memorylThis function allows the change of state token. Use with care, because it can allow mutation to escape the v monad. primal-memorysAllocated memory is not cleared, so make sure to fill it in properly, otherwise you might find some garbage there. primal-memory.Fill the mutable array with zeros efficiently. primal-memory"Get the count of elements of type a that can fit into bytes as well as the slack number of bytes that would be leftover in case when total number of bytes available is not exactly divisable by the size of the element that will be stored in the memory chunk. primal-memory#Get the number of elements of type a that can fit into bytes as well as the slack number of bytes that would be leftover in case when total number of bytes available is not exactly divisable by the size of the element that will be stored in the memory chunk. primal-memoryIt is only guaranteed to convert the whole memory to a list whenever the size of allocated memory is exactly divisible by the size of the element, otherwise there will be some slack left unaccounted for. primal-memoryReturns pc if the full list did fit into the supplied memory chunk exactly. Otherwise it will return either q3 if the list was smaller than allocated memory or rG if the list was bigger than the available memory and did not fit into . primal-memory(If the list is bigger than the supplied R a then r, ordering will be returned, along with the g fully filled with the prefix of the list. On the other hand if the list is smaller than the supplied R, q with partially filled  will returned. In the latter case expect some garbage at the end of the allocated memory, since no attempt is made to zero it out. Exact match obviously results in an p. primal-memoryMAllocate new memory region and append second bytes region after the first one primal-memory1Perform atomic modification of an element in the  at the supplied index. Returns the actual value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe.  primal-memory1Perform atomic modification of an element in the ! at the supplied index. Returns w if swap was successfull and false otherwise. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe.  primal-memory Just like  k, but also returns the actual value, which will match the supplied expected value if the returned flag is wNote= - Bounds are not checked, therefore this function is unsafe.  primal-memoryPerform atomic read of k at the supplied index. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe.  primal-memoryPerform a write into v at the supplied index atomically. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe.  primal-memory1Perform atomic modification of an element in the = at the supplied index. Returns the artifact of computation bV. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the m at the supplied index. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the  at the supplied index. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the  at the supplied index. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the m at the supplied index. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory'Add a numeric value to an element of a , corresponds to (x) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory'Add a numeric value to an element of a , corresponds to (x)~ done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory.Subtract a numeric value from an element of a , corresponds to (y) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory.Subtract a numeric value from an element of a , corresponds to (y)| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory,Binary conjunction (AND) of an element of a * with the supplied value, corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory,Binary conjunction (AND) of an element of a * with the supplied value, corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory9Negation of binary conjunction (NAND) of an element of a * with the supplied value, corresponds to \x y ->  (x  y) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory:Negation of binary conjunction (NAND) of an element of a * with the supplied value, corresponds to \x y ->  (x  y)} done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory+Binary disjunction (OR) of an element of a * with the supplied value, corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory+Binary disjunction (OR) of an element of a * with the supplied value, corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory6Binary exclusive disjunction (XOR) of an element of a * with the supplied value, corresponds to  done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory6Binary exclusive disjunction (XOR) of an element of a * with the supplied value, corresponds to | done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory)Binary negation (NOT) of an element of a , corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory)Binary negation (NOT) of an element of a , corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe.  primal-memoryFirst memory region primal-memorySecond memory region primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryExpected old value primal-memory New value  primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryExpected old value primal-memory New value  primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryExpected old value primal-memory New value  primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes.  primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes.  primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memorybFunction that is applied to the old value and returns new value and some artifact of computation b primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memory@Function that is applied to the old value and returns new value. primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryCFunction that is applied to the old value and returns the new value primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryCFunction that is applied to the old value and returns the new value primal-memoryArray to be mutated primal-memoryIndex is in elements of a, rather than bytes. primal-memoryCFunction that is applied to the old value and returns the new value   :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` !"#$%&'()*+,-./01234567      !"#$%&'r+,67!% "#$&'()*-0123./45      !"#$%&'(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone@}~@}~(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.=>?@AHIMSVX( primal-memory!A mutable array of bytes of type e* primal-memory$An immutable array of bytes of type e: primal-memoryShrink mutable bytes to new specified count of elements. The new count must be less than or equal to the current count as reported by getCountMByteArray.; primal-memory)Attempt to resize mutable bytes in place.:New bytes might be allocated, with the copy of an old one.@Old references should not be kept around to allow GC to claim it=Old references should not be used to avoid undefined behaviorG primal-memory)Read-only access, but it is not enforced.7 primal-memorySize in number of bytesA primal-memoryChunk of memory to fill primal-memoryOffset in number of elements primal-memoryNumber of cells to fill primal-memoryA value to fill the cells with()*+,-./0123456789:;<=>?@ABC*+()-.,01/4675:;<=>9823?@ABC(c) Alexey Kuleshevich 2020BSD3(Alexey Kuleshevich <alexey@kuleshevi.ch> experimental non-portableNone.=>?@AFHIVXR6!] primal-memoryShrink mutable address to new specified size in number of elements. The new count must be less than or equal to the current as reported by e.^ primal-memoryShrink mutable address to new specified size in bytes. The new count must be less than or equal to the current as reported by f.q primal-memoryDiscarding the original < will trigger finalizers that were attached to it, because TR does not retain any finalizers. This is a unsafe cast therefore modification of * will be reflected in resulting immutable T. Pointer created with malloc cannot be converted to T and will result in zr primal-memory^Discarding the original ForeignPtr will trigger finalizers that were attached to it, because P6 does not retain any finalizers. Pointer created with malloc cannot be converted to P and will result in z primal-memoryO(1) - Cast an immutable T to an immutable  primal-memoryO(1) - Cast an immutable T to an immutable   primal-memoryO(1) - Cast an immutable   to an immutable T. In a most common case when  < is not backed by pinned memory, this function will return z. primal-memoryO(1) - Cast an immutable  to TR. Also returns the original length of ByteString, which will be less or equal to  countOfAddr in the produced T. primal-memoryO(1) - Cast an immutable  to a mutable PR. Also returns the original length of ByteString, which will be less or equal to getCountOfMAddr in the produced P.Unsafe - Further modification of P will affect the source  primal-memory1Perform atomic modification of an element in the P= at the supplied index. Returns the artifact of computation bV. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the P! at the supplied index. Returns w if swap was successfull and false otherwise. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory Just like k, but also returns the actual value, which will match the supplied expected value if the returned flag is wNote= - Bounds are not checked, therefore this function is unsafe. primal-memory)Perform atomic read of an element in the Pl at the supplied offset. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory*Perform atomic write of an element in the Pl at the supplied offset. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the P= at the supplied index. Returns the artifact of computation bV. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the Pm at the supplied index. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the P at the supplied index. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory1Perform atomic modification of an element in the Pm at the supplied index. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory'Add a numeric value to an element of a P, corresponds to (x) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory'Add a numeric value to an element of a P, corresponds to (x)~ done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory.Subtract a numeric value from an element of a P, corresponds to (y) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory.Subtract a numeric value from an element of a P, corresponds to (y)| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory,Binary conjunction (AND) of an element of a P* with the supplied value, corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory,Binary conjunction (AND) of an element of a P* with the supplied value, corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory9Negation of binary conjunction (NAND) of an element of a P* with the supplied value, corresponds to \x y ->  (x  y) done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory:Negation of binary conjunction (NAND) of an element of a P* with the supplied value, corresponds to \x y ->  (x  y)} done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory+Binary disjunction (OR) of an element of a P* with the supplied value, corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory+Binary disjunction (OR) of an element of a P* with the supplied value, corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory6Binary exclusive disjunction (XOR) of an element of a P* with the supplied value, corresponds to  done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory6Binary exclusive disjunction (XOR) of an element of a P* with the supplied value, corresponds to | done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory)Binary negation (NOT) of an element of a P, corresponds to () done atomically. Returns the previous value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory)Binary negation (NOT) of an element of a P, corresponds to ()| done atomically. Returns the new value. Offset is in number of elements, rather than bytes. Implies a full memory barrier.Note= - Bounds are not checked, therefore this function is unsafe. primal-memory)Read-only access, but it is not enforced.  primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memoryExpected old value primal-memory New value primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memoryExpected old value primal-memory New value primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memoryExpected old value primal-memory New value primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memorybFunction that is applied to the old value and returns new value and some artifact of computation b primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memory-Function that is applied to the current value primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes. primal-memory)Function that is applied to the old value primal-memoryReturns the old value primal-memoryArray to be mutated primal-memoryIndex is in elements of e, rather than bytes primal-memory)Function that is applied to the old value primal-memoryReturns the new value   :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~_TUVWXZbdc`ghiwxyuvjklPQRSY[\_]^mfeaz{|}~nstopqr{ !"#$%&'()'*+',-'(.'*//00123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abccdefghijklmnopqrstuvwxyz{|}~           !"#$%&'()*+,-./0123456789:;<<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdeefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZI[I\I]I^I_I_I`IaIaIbIcIcIdefefeghihjhklmnonp'qsrtruvwst|}~uvwxyz{|}~,primal-memory-0.1.0.0-JVIrJf5pNG7LXygDYAXzyzData.Prim.Memory.ForeignPtrData.Prim.Memory.ByteStringData.Prim.Memory.InternalData.Prim.Memory.BytesData.Prim.Memory.PtrData.Prim.Memory.ByteArrayData.Prim.Memory.AddrData.Prim.Memory.Bytes.InternalfromMutableByteArray#toMutableByteArray#fromByteArray# toByteArray# toPinnedBytestoPinnedMBytesForeign.ForeignPtrmallocForeignPtrArraymallocPlainForeignPtrArrayData.ByteStringpack ByteStringunpack Data.Bits.&. complement.|.xorData.Prim.MemorybaseGHC.ForeignPtr ForeignPtrPlainPtr MallocPtrPlainForeignPtrForeignPtrContentscastForeignPtrunsafeForeignPtrToPtr FinalizerPtrFinalizerEnvPtrbytestring-0.10.8.2Data.ByteString.Short.InternalSBSData.ByteString.InternalPS Data.ByteString.Builder.InternalBuilderShortByteStringMBytesBytesPinnedPinInccompareByteOffBytes indexOffBytesindexByteOffBytes allocMBytesallocUnpinnedMBytesallocPinnedMBytesallocAlignedMBytescallocAlignedMBytesgetByteCountMBytes freezeMBytes thawBytesbyteCountBytes shrinkMBytes resizeMBytes reallocMBytes countBytesgetCountMBytes readOffMBytesreadByteOffMByteswriteOffMByteswriteByteOffMBytes isPinnedBytesisPinnedMBytes setMBytes toPtrBytes toPtrMBytes withPtrByteswithNoHaltPtrBytes withPtrMByteswithNoHaltPtrMBytestoForeignPtrBytestoForeignPtrMBytes isSameBytesisSamePinnedBytesbyteStringConvertErrorcopyPtrToMBytescopyByteOffPtrToMBytescopyBytesToPtrcopyByteOffBytesToPtrcopyMBytesToPtrcopyByteOffMBytesToPtrmovePtrToMBytesmoveByteOffPtrToMBytesmoveMBytesToPtrmoveByteOffMBytesToPtrcompareByteOffBytesToPtrcompareByteOffPtrToBytes MByteStringtoByteStringBytestoShortByteStringBytesfromShortByteStringBytestoBuilderBytesfromBuilderBytesfromLazyByteStringBytesfromByteStringByteswithPtrByteStringwithNoHaltPtrByteString PtrAccess toForeignPtr withPtrAccesswithNoHaltPtrAccesswithForeignPtrwithNoHaltForeignPtrtouchForeignPtr newForeignPtrnewForeignPtrEnvnewForeignPtr_mallocForeignPtrmallocCountForeignPtrmallocCountForeignPtrAlignedmallocByteCountForeignPtr mallocByteCountForeignPtrAlignedaddForeignPtrFinalizeraddForeignPtrFinalizerEnvmallocPlainForeignPtrmallocCountPlainForeignPtr!mallocCountPlainForeignPtrAlignedmallocByteCountPlainForeignPtr%mallocByteCountPlainForeignPtrAlignednewConcForeignPtraddForeignPtrConcFinalizerfinalizeForeignPtrplusOffForeignPtrplusByteOffForeignPtrminusByteOffForeignPtrminusOffForeignPtrminusOffRemForeignPtr$fPtrAccesssMBytes$fPtrAccesssBytes$fPtrAccesssMByteString$fPtrAccesssByteString$fPtrAccesssForeignPtrMMemView mmvOffsetmmvCountmmvMemMemViewmvOffsetmvCountmvMemMemState unMemStateMemWrite readOffMemreadByteOffMem writeOffMemwriteByteOffMemmoveByteOffToMBytesMemmoveByteOffToPtrMemcopyByteOffMemmoveByteOffMemsetMemMemAlloc FrozenMemgetByteCountMemallocByteCountMemthawMem freezeMem resizeMemMemRead byteCountMem indexOffMemindexByteOffMemcopyByteOffToMBytesMemcopyByteOffToPtrMemcompareByteOffToPtrMemcompareByteOffToBytesMemcompareByteOffMemmodifyFetchOldMemmodifyFetchNewMemmodifyFetchOldMemMmodifyFetchNewMemMdefaultResizeMem cycleMemNemptyMem singletonMemallocMem allocZeroMem createMemST createMemST_createZeroMemSTcreateZeroMemST_copyMemmoveMem appendMem concatMem thawCopyMem freezeCopyMem thawCloneMemfreezeCloneMem convertMemcountMem countRemMem getCountMemgetCountRemMemcloneeqMem compareMem toListMemtoListSlackMem foldrCountMem loadListMemN loadListMemN_ loadListMem loadListMem_ fromListMemN fromListMemN_ fromListMemfromByteListMem toByteListMem mapByteMem mapByteOffMem mapByteMemMmapByteOffMemMforByteOffMemM_ loopShortM loopShortM'izipWithByteOffMemM_izipWithOffMemM_ showsHexMemwithScrubbedMem $fMonoidBytes$fSemigroupBytes $fOrdBytes $fEqBytes $fIsListBytes $fShowBytes$fMemReadBytes$fMemReadShortByteString$fMemReadByteString$fMemWriteMBytes$fMemWriteMByteString$fMemAllocMBytes$fMemAllocMByteString$fMemWriteMemState isSameMByteseqBytes compareBytescoerceStateMBytes emptyBytes isEmptyBytessingletonBytessingletonMBytes cloneBytes cloneMBytescopyBytesToMBytesmoveMBytesToMBytes createBytes createBytes_ createBytesSTcreateBytesST_ callocMBytes zeroMByteswithCloneMByteswithCloneMBytes_withCloneMBytesSTwithCloneMBytesST_ countRemBytesgetCountRemOfMBytes toListBytestoListSlackBytesloadListMBytesloadListMBytes_fromListBytesN_fromListBytesN fromListBytes appendBytes concatBytesrelaxPinnedBytesrelaxPinnedMBytesensurePinnedBytesensurePinnedMBytes casMBytes casBoolMBytescasBoolFetchMBytesatomicReadMBytesatomicWriteMBytesatomicModifyMBytesatomicModifyMBytes_atomicModifyFetchOldMBytesatomicBoolModifyFetchOldMBytesatomicModifyFetchNewMBytesatomicAddFetchOldMBytesatomicAddFetchNewMBytesatomicSubFetchOldMBytesatomicSubFetchNewMBytesatomicAndFetchOldMBytesatomicAndFetchNewMBytesatomicNandFetchOldMBytesatomicNandFetchNewMBytesatomicOrFetchOldMBytesatomicOrFetchNewMBytesatomicXorFetchOldMBytesatomicXorFetchNewMBytesatomicNotFetchOldMBytesatomicNotFetchNewMBytesprefetchBytes0prefetchMBytes0prefetchBytes1prefetchMBytes1prefetchBytes2prefetchMBytes2prefetchBytes3prefetchMBytes3 MByteArray ByteArray castByteArrayfromBytesByteArraytoBytesByteArraycastMByteArrayfromMBytesMByteArraytoMBytesMByteArray sizeByteArraygetSizeMByteArrayallocMByteArrayallocUnpinnedMByteArrayallocPinnedMByteArrayallocAlignedMByteArrayfreezeMByteArray thawByteArrayshrinkMByteArrayresizeMByteArrayreallocMByteArrayisPinnedByteArrayisPinnedMByteArrayreadMByteArraywriteMByteArray setMByteArraycopyByteArrayToMByteArraymoveMByteArrayToMByteArray$fShowByteArray$fIsStringByteArray$fIsListByteArray$fPtrAccesssByteArray$fMemAllocMByteArray$fPtrAccesssMByteArray$fNFDataByteArray$fSemigroupByteArray$fMonoidByteArray$fMemReadByteArray$fNFDataMByteArray$fMemWriteMByteArrayMAddr mAddrAddr# mAddrMBytesAddr addrAddr# addrBytescastAddr castMAddr fromBytesAddr allocMAddr callocMAddr shrinkMAddrshrinkByteCountMAddr reallocMAddr plusOffAddr plusOffMAddr curOffAddr countAddr byteCountAddr getCountMAddrgetByteCountMAddr indexAddr indexOffAddrindexByteOffAddr withPtrAddr withAddrAddr#withNoHaltPtrAddr curOffMAddr withPtrMAddrtoForeignPtrAddrtoForeignPtrMAddrfromForeignPtrAddrfromForeignPtrMAddrwithAddrMAddr#withNoHaltPtrMAddrthawAddr freezeMAddrreadAddr readOffAddrreadByteOffAddr readMAddr readOffMAddrreadByteOffMAddr writeMAddr writeOffMAddrwriteByteOffMAddrcopyAddrToMAddrmoveMAddrToMAddrsetMAddrtoByteStringAddrtoShortByteStringAddrfromShortByteStringAddrfromByteStringAddrfromByteStringMAddr casOffMAddrcasBoolOffMAddrcasBoolFetchOffMAddratomicReadOffMAddratomicWriteOffMAddratomicModifyOffMAddratomicModifyOffMAddr_atomicModifyFetchOldOffMAddratomicModifyFetchNewOffMAddratomicAddFetchOldOffMAddratomicAddFetchNewOffMAddratomicSubFetchOldOffMAddratomicSubFetchNewOffMAddratomicAndFetchOldOffMAddratomicAndFetchNewOffMAddratomicNandFetchOldOffMAddratomicNandFetchNewOffMAddratomicOrFetchOldOffMAddratomicOrFetchNewOffMAddratomicXorFetchOldOffMAddratomicXorFetchNewOffMAddratomicNotFetchOldOffMAddratomicNotFetchNewOffMAddr prefetchAddr0prefetchMAddr0 prefetchAddr1prefetchMAddr1 prefetchAddr2prefetchMAddr2 prefetchAddr3prefetchMAddr3prefetchOffAddr0prefetchOffMAddr0prefetchOffAddr1prefetchOffMAddr1prefetchOffAddr2prefetchOffMAddr2prefetchOffAddr3prefetchOffMAddr3 $fMemReadAddr$fPtrAccesssAddr $fNFDataAddr $fMonoidAddr$fSemigroupAddr $fIsListAddr$fIsStringAddr $fShowAddr$fEqAddr$fMemWriteMAddr$fMemAllocMAddr$fPtrAccesssMAddr $fNFDataMAddrcastPinnedMBytescastPinnedBytesfromForeignPtrBytescopyByteOffBytesToMBytesmoveByteOffMBytesToMBytesghc-primGHC.PrimcoerceData.Typeable.InternalTypeableGHC.Base<>Monoidmemptymappendmconcat GHC.TypesIntGHC.IntInt8Int16Int32Int64 RealWorldWordGHC.WordWord8Word16Word32Word64GHC.PtrPtrFunPtr Coercible Data.MonoidFirstgetFirstLastgetLastApgetApData.Semigroup.InternalDualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductAltgetAlt Data.ProxyProxy Foreign.Ptr intPtrToPtr ptrToIntPtr wordPtrToPtr ptrToWordPtrWordPtrIntPtrcastPtrToFunPtrcastFunPtrToPtr castFunPtr nullFunPtrminusPtralignPtrplusPtrcastPtrnullPtr byteSwap64 byteSwap32 byteSwap16%primal-0.1.0.0-3ITPPqWabZnLbM7R5UMiTJForeign.Prim.PtrfreeHaskellFunPtrprefetchOffPtr3prefetchOffPtr2prefetchOffPtr1prefetchOffPtr0 prefetchPtr3 prefetchPtr2 prefetchPtr1 prefetchPtr0atomicNotFetchNewOffPtratomicNotFetchOldOffPtratomicXorFetchNewOffPtratomicXorFetchOldOffPtratomicOrFetchNewOffPtratomicOrFetchOldOffPtratomicNandFetchNewOffPtratomicNandFetchOldOffPtratomicAndFetchNewOffPtratomicAndFetchOldOffPtratomicSubFetchNewOffPtratomicSubFetchOldOffPtratomicAddFetchNewOffPtratomicAddFetchOldOffPtratomicModifyFetchNewOffPtratomicModifyFetchOldOffPtratomicModifyOffPtr_atomicModifyOffPtr casOffPtrcompareByteOffPtrToPtrcomparePtrToPtrmoveByteOffPtrToPtr movePtrToPtrcopyByteOffPtrToPtr copyPtrToPtrminusOffRemPtr minusOffPtrminusByteOffPtr plusOffPtrplusByteOffPtrwritePtrreadPtrwriteByteOffPtr writeOffPtrreadByteOffPtr readOffPtr setOffPtr Data.PrimprefetchValue3prefetchValue2prefetchValue1prefetchValue0fromByteOffRem fromByteOfffromOff# toByteOff offAsProxyfromByteCountRem fromByteCount countAsProxy toByteCount fromCount fromCount#alignmentProxy alignmentType alignmentbyteCountProxy byteCountType byteCountSizeunSizeCountunCountOffunOffData.Prim.AtomAtomunAtomData.Prim.AtomicAtomic AtomicCount AtomicBitsData.Prim.ClassPrimControl.Prim.Monad.InternalRW MonadPrimData.ByteString.Lazy.InternalForeign.ForeignPtr.ImpmallocForeignPtrBytesmallocForeignPtrAlignedBytesIOEQLTGTGHC.ShowShowS ByteArray#MutableByteArray#GHC.STSTTrueGHC.Num+- GHC.MaybeNothing