h$׊"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                (c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy  non-portableNone>?Q primitive PrimBase's state token type can be annoying to handle in constraints. This typeclass lets users (visually) notice  2 equality constraints less, by witnessing that s ~   m.  primitive PrimMonad's state token type can be annoying to handle in constraints. This typeclass lets users (visually) notice  2 equality constraints less, by witnessing that s ~   m.  primitive8Class of primitive monads for state-transformer actions.Unlike  #, this typeclass requires that the Monad be fully expressed as a state transformer, therefore disallowing other monad transformers on top of the base IO or ST.  primitive+Expose the internal structure of the monad.  primitiveClass of monads which can perform primitive state-transformer actions.  primitiveState token type. primitiveExecute a primitive operation. primitive-Execute a primitive operation with no result. primitiveLifts a   into another  , with the same underlying state token type. primitive Convert a  , to another monad with the same state token. primitive Convert a   with a  state token to  primitive Convert a   to  primitive Convert an  action to a  . primitive Convert an  action to a  . primitive Convert a   to another monad with a possibly different state token. This operation is highly unsafe! primitive Convert any   to  with an arbitrary state token. This operation is highly unsafe! primitive Convert any   to ". This operation is highly unsafe! primitive Convert an - action with an arbitrary state token to any  #. This operation is highly unsafe! primitive Convert an  action to any  #. This operation is highly unsafe! primitiveSee 9. This function is not recommended for the same reasons. primitive8Generally, do not use this function. It is the same as accursedUnutterablePerformIO from  bytestring and is well behaved under narrow conditions. See the documentation of that function to get an idea of when this is sound. In most cases $GHC.IO.Unsafe.unsafeDupablePerformIO should be preferred. primitiveSee . This function is not recommended for the same reasons. Prefer runST when s is free. primitive/Create an action to force a value; generalizes  ) primitive5 primitive9 primitive  !"  !"  (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone 3*^ = primitive=Mutable boxed arrays associated with a primitive state token.@ primitive Boxed arrays.C primitive-The number of elements in an immutable array.D primitive*The number of elements in a mutable array.E primitiveCreate a new mutable array of the specified size and initialise all elements with the given value.Note:; this function does not check if the input is non-negative.F primitive/Read a value from the array at the given index.Note:+ this function does not do bounds checking.G primitive.Write a value to the array at the given index.Note:+ this function does not do bounds checking.H primitive9Read a value from the immutable array at the given index.Note:+ this function does not do bounds checking.I primitiveRead a value from the immutable array at the given index, returning the result in an unboxed unary tuple. This is currently used to implement folds.Note:+ this function does not do bounds checking.J primitiveMonadically 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: copy marr arr ... = do ... writeArray marr i (indexArray arr i) ... ...,But since the arrays are lazy, the calls to H! will not be evaluated. Rather, marr will be filled with thunks each of which would retain a reference to arr&. This is definitely not what we want!With J, 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.Note:+ this function does not do bounds checking.K primitive0Create an immutable copy of a slice of an array.This operation makes a copy of the specified section, so it is safe to continue using the mutable array afterward.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked.L primitiveConvert a mutable array to an immutable one without copying. The array should not be modified after the conversion.M primitive:Create a mutable array from a slice of an immutable array.This operation makes a copy of the specified slice, so it is safe to use the immutable array afterward.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked.N primitiveConvert an immutable array to an mutable one without copying. The immutable array should not be used after the conversion.O primitive>= unsafeFreezeArrayV primitiveCreate an array of the given size with a default value, apply the monadic function and freeze the result. If the size is 0, return T" (rather than a new copy thereof). createArray 0 _ _ = emptyArray createArray n x f = runArray $ do mary <- newArray n x f mary pure maryW primitiveThis is the fastest, most straightforward way to traverse an array, but it only works correctly with a sufficiently "affine"  0 instance. In particular, it must only produce one result array.  >-transformed monads, for example, will not work right at all.X primitive*Strict map over the elements of the array.Y primitiveCreate an array from a list of a known length. If the length of the list does not match the given length, this throws an exception.Z primitiveCreate an array from a list.\ primitive^ primitivea primitivel primitivem primitiveLexicographic ordering. Subject to change between major versions.n primitiveK primitivesource primitiveoffset primitivelengthM primitivesource primitiveoffset primitivelengthP primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of elements to copyQ primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of elements to copyR primitive source array primitiveoffset into destination array primitivenumber of elements to copyS primitive source array primitiveoffset into destination array primitivenumber of elements to copy =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ @AB=>?EFGHJIKMUVLNOPQRSCDTYZXWBSD2 non-portableNone7 v primitiveA synchronizing variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.x primitive Create a new v that is initially empty.y primitive Create a new v" that holds the supplied argument.z primitiveReturn the contents of the v . If the v is currently empty, z% will wait until it is full. After a z, the v is left empty..There are two further important properties of z:z is single-wakeup. That is, if there are multiple threads blocked in z , and the v becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its z operation.(When multiple threads are blocked on an v, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using vs.{ primitive#Atomically read the contents of an v . If the v is currently empty, { will wait until it is full. {# is guaranteed to receive the next |.Multiple Wakeup: { is multiple-wakeup, so when multiple readers are blocked on an v,, all of them are woken up at the same time./It is single-wakeup instead of multiple-wakeup.5It might not receive the value from the next call to |4 if there is already a pending thread blocked on z.&If another thread puts a value in the v in between the calls to z and |, that value may be overridden.| primitivePut a value into an v . If the v is currently full, |" will wait until it becomes empty..There are two further important properties of |:| is single-wakeup. That is, if there are multiple threads blocked in | , and the v becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its | operation.(When multiple threads are blocked on an v, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using vs.} primitiveA non-blocking version of z. The }% function returns immediately, with  if the v was empty, or  a if the v was full with contents a. After }, the v is left empty.~ primitiveA non-blocking version of |. The ~% function attempts to put the value a into the v , returning  if it was successful, or  otherwise. primitiveA non-blocking version of {. The % function returns immediately, with  if the v was empty, or  a if the v was full with contents a./It is single-wakeup instead of multiple-wakeup.)In the presence of other threads calling |,  may block.&If another thread puts a value in the v in between the calls to } and |, that value may be overridden. primitiveCheck whether a given v is empty.Notice that the boolean value returned is just a snapshot of the state of the v3. By the time you get to react on its result, the v may have been filled (or emptied) - so be extremely careful when using this operation. Use } instead if possible. vwxyz{|}~ vwyx|{z~} (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone8"" (c) Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy  non-portableNone 94(c) Justin Bonnar 2011, Roman Leshchinskiy 2011-2012 BSD-style'Roman Leshchinskiy  non-portableNone3? primitiveA  behaves like a single-element mutable array associated with a primitive state token. primitive Create a new " with the specified initial value. primitiveRead the value of a . primitiveWrite a new value into a . primitive$Atomically mutate the contents of a ."This function is useful for using  in a safe way in a multithreaded program. If you only have one  , then using 7 to access and modify it will prevent race conditions.$Extending the atomicity to multiple s is problematic, so if you need to do anything more complicated, using  instead is a good idea. does not apply the function strictly. This means if a program calls  many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. To avoid this problem, use  instead. primitiveStrict version of ,. This forces both the value stored in the  as well as the value returned. primitiveMutate the contents of a . does not apply the function strictly. This means if a program calls  many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. To avoid this problem, use  instead. primitiveStrict version of .   (c) 2015 Dan DoelBSD3libraries@haskell.org non-portableNone3567U6 primitive!Create a new small mutable array.Note:; this function does not check if the input is non-negative. primitive5Read the element at a given index in a mutable array.Note:+ this function does not do bounds checking. primitive6Write an element at the given idex in a mutable array.Note:+ this function does not do bounds checking. primitive)Look up an element in an immutable array.The purpose of returning a result using a monad is to allow the caller to avoid retaining references to the array. Evaluating the return value will cause the array lookup to be performed, even though it may not require the element of the array to be evaluated (which could throw an exception). For instance: data Box a = Box a ... f sa = case indexSmallArrayM sa 0 of Box x -> ...x" is not a closure that references sa% as it would be if we instead wrote: let x = indexSmallArray sa 0It also does not prevent sa from being garbage collected. Note that  is not adequate for this use, as it is a newtype, and cannot be evaluated without evaluating the element.Note:+ this function does not do bounds checking. primitive)Look up an element in an immutable array.Note:+ this function does not do bounds checking. primitiveRead a value from the immutable array at the given index, returning the result in an unboxed unary tuple. This is currently used to implement folds.Note:+ this function does not do bounds checking. primitive/Create a copy of a slice of an immutable array.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked. primitive,Create a copy of a slice of a mutable array.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked. primitiveCreate an immutable array corresponding to a slice of a mutable array.-transformed monads, for example, will not work right at all. primitive*Strict map over the elements of the array. primitive:Execute the monadic action and freeze the resulting array. 6runSmallArray m = runST $ m >>= unsafeFreezeSmallArray primitiveCreate an array of the given size with a default value, apply the monadic function and freeze the result. If the size is 0, return " (rather than a new copy thereof). createSmallArray 0 _ _ = emptySmallArray createSmallArray n x f = runSmallArray $ do mary <- newSmallArray n x f mary pure mary primitive The empty . primitive Create a  from a list of a known length. If the length of the list does not match the given length, this throws an exception. primitive Create a  from a list. primitiveShrink the mutable array in place. The size given must be equal to or less than the current size of the array. This is not checked. primitive primitive primitive primitiveLexicographic ordering. Subject to change between major versions. primitive primitive  primitivesize primitiveinitial contents primitivearray primitiveindex primitivearray primitiveindex primitive new element primitivearray primitiveindex primitivearray primitiveindex primitivesource primitiveoffset primitivelength primitivesource primitiveoffset primitivelength primitivesource primitiveoffset primitivelength primitivesource primitiveoffset primitivelength primitive destination primitivedestination offset primitivesource primitive source offset primitivelength primitive destination primitivedestination offset primitivesource primitive source offset primitivelength1 (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone ./238fw primitiveNewtype that uses a  instance to give rise to a 6 instance. This type is intended to be used with the  DerivingVia extension available in GHC 8.6 and up. For example, consider a user-defined & instance for a multi-word data type. data Uuid = Uuid Word64 Word64 deriving Storable via (PrimStorable Uuid) instance Prim Uuid where ... Writing the . instance is tedious and unavoidable, but the # instance comes for free once the  instance is written. primitiveClass of types supporting primitive array operations. This includes interfacing with GC-managed memory (functions suffixed with  ByteArray#) and interfacing with unmanaged memory (functions suffixed with Addr#%). Endianness is platform-dependent. primitiveSize of values of type a. The argument is not used. primitiveAlignment of values of type a. The argument is not used. primitiveRead a value from the array. The offset is in elements of type a rather than in bytes. primitiveRead a value from the mutable array. The offset is in elements of type a rather than in bytes. primitiveWrite a value to the mutable array. The offset is in elements of type a rather than in bytes. primitiveFill 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. primitiveRead 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. primitiveRead 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. primitiveWrite 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. primitiveFill 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. primitiveSize of values of type a. The argument is not used.8This function has existed since 0.1, but was moved from  to  in version 0.6.3.0. primitiveAlignment of values of type a. The argument is not used.8This function has existed since 0.1, but was moved from  to  in version 0.6.3.0. primitiveAn implementation of  that calls 6 to set each element. This is helpful when writing a  instance for a multi-word data type for which there is no CPU-accelerated way to broadcast a value to contiguous memory. It is typically used alongside . For example: data Trip = Trip Int Int Int instance Prim Trip sizeOf# _ = 3# *# sizeOf# (undefined :: Int) alignment# _ = alignment# (undefined :: Int) indexByteArray# arr# i# = ... readByteArray# arr# i# = ... writeByteArray# arr# i# (Trip a b c) = \s0 -> case writeByteArray# arr# (3# *# i#) a s0 of s1 -> case writeByteArray# arr# ((3# *# i#) +# 1#) b s1 of s2 -> case writeByteArray# arr# ((3# *# i#) +# 2# ) c s2 of s3 -> s3 setByteArray# = defaultSetByteArray# indexOffAddr# addr# i# = ... readOffAddr# addr# i# = ... writeOffAddr# addr# i# (Trip a b c) = \s0 -> case writeOffAddr# addr# (3# *# i#) a s0 of s1 -> case writeOffAddr# addr# ((3# *# i#) +# 1#) b s1 of s2 -> case writeOffAddr# addr# ((3# *# i#) +# 2# ) c s2 of s3 -> s3 setOffAddr# = defaultSetOffAddr# primitiveAn implementation of  that calls , to set each element. The documentation of ) provides an example of how to use this. primitive primitive primitive primitive primitive primitive primitive primitive primitive primitive primitive primitive primitiveoffset primitivelength primitiveoffset primitivelength (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone 3O- primitive>= unsafeFreezeByteArray primitive primitiveNon-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions. primitive primitiveBehavior changed in 0.7.2.0. Before 0.7.2.0, this instance rendered 8-bit words less than 16 as a single hexadecimal digit (e.g. 13 was 0xD). Starting with 0.7.2.0, all 8-bit words are represented as two digits (e.g. 13 is 0x0D). primitive(Respects array pinnedness for GHC >= 8.2 primitivesize primitive alignment primitivesource primitiveoffset in bytes primitivelength in bytes primitivesource primitiveoffset in bytes primitivelength in bytes primitivenew size primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of bytes to copy primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of bytes to copy primitive destination primitive source array primitive:offset into source array, interpreted as elements of type a primitivenumber of elements to copy primitivedestination array primitive-destination offset given in elements of type a primitivesource pointer primitivenumber of elements primitive destination primitive source array primitive:offset into source array, interpreted as elements of type a primitivenumber of elements to copy primitive destination primitive source array primitiveoffset into source array primitivenumber of bytes to copy primitive destination primitive source array primitiveoffset into source array primitivenumber of bytes to copy primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of bytes to copy primitive array to fill primitiveoffset into array primitivenumber of values to fill primitivevalue to fill with primitive array to fill primitiveoffset into array primitivenumber of bytes to fill primitivebyte to fill with primitivearray A primitiveoffset A, given in bytes primitivearray B primitiveoffset B, given in bytes primitive#length of the slice, given in bytes primitive source array primitiveoffset into destination array primitivenumber of bytes to copy primitive source array primitiveoffset into destination array primitivenumber of bytes to copy,,  (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone Z primitiveMutable primitive arrays associated with a primitive state token. These can be written to and read from in a monadic context that supports sequencing, such as  or . Typically, a mutable primitive array will be built and then converted to an immutable primitive array using . However, it is also acceptable to simply discard a mutable primitive array since it lives in managed memory and will be garbage collected when no longer referenced. primitive4Arrays of unboxed elements. This accepts types like , ,  and *, as well as their fixed-length variants (Word8, Word16+, etc.). Since the elements are unboxed, a ? is strict in its elements. This differs from the behavior of !, which is lazy in its elements. primitive Create a  from a list. primArrayFromList vs =  (length vs) vs primitive Create a  from a list of a known length. If the length of the list does not match the given length, this throws an exception. primitive Convert a  to a list. primitive The empty . primitiveCreate a new mutable primitive array of the given length. The underlying memory is left uninitialized.Note:; this function does not check if the input is non-negative. primitiveResize a mutable primitive array. The new size is given in elements.This will either resize the array in-place or, if not possible, allocate the contents into a new, unpinned array and copy the original array's contents.+To avoid undefined behaviour, the original ( shall not be accessed anymore after a  has been performed. Moreover, no reference to the old one should be kept in order to allow garbage collection of the original  in case a new  had to be allocated. primitiveShrink a mutable primitive array. The new size is given in elements. It must be smaller than the old size. The array will be resized in place. primitive/Read a value from the array at the given index.Note:+ this function does not do bounds checking. primitive$Write an element to the given index.Note:+ this function does not do bounds checking. primitiveCopy part of a mutable array into another mutable array. In the case that the destination and source arrays are the same, the regions may overlap.Note:6 this function does not do bounds or overlap checking. primitive1Copy part of an array into another mutable array.Note:6 this function does not do bounds or overlap checking. primitiveCopy a slice of an immutable primitive array to a pointer. The offset and length are given in elements of type a". This function assumes that the  instance of a agrees with the Storable instance.Note:6 this function does not do bounds or overlap checking. primitiveCopy a slice of a mutable primitive array to a pointer. The offset and length are given in elements of type a". This function assumes that the  instance of a agrees with the Storable instance.Note:6 this function does not do bounds or overlap checking. primitiveCopy from a pointer to a mutable primitive array. The offset and length are given in elements of type a". This function assumes that the  instance of a agrees with the Storable instance.Note:6 this function does not do bounds or overlap checking. primitive7Fill a slice of a mutable primitive array with a value.Note:+ this function does not do bounds checking. primitive>Get the size of a mutable primitive array in elements. Unlike , this function ensures sequencing in the presence of resizing. primitiveSize of the mutable primitive array in elements. This function shall not be used on primitive arrays that are an argument to or a result of  or . primitive7Check if the two arrays refer to the same memory block. primitiveCreate an immutable copy of a slice of a primitive array. The offset and length are given in elements.This operation makes a copy of the specified section, so it is safe to continue using the mutable array afterward.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked. primitiveCreate a mutable primitive array from a slice of an immutable primitive array. The offset and length are given in elements.This operation makes a copy of the specified slice, so it is safe to use the immutable array afterward.Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked. primitiveConvert a mutable primitive array to an immutable one without copying. The array should not be modified after the conversion. primitiveConvert an immutable array to a mutable one without copying. The original array should not be used after the conversion. primitive0Read a primitive value from the primitive array.Note:+ this function does not do bounds checking. primitive2Get the size, in elements, of the primitive array. primitiveCheck whether or not the primitive array is pinned. Pinned primitive arrays cannot be moved by the garbage collector. It is safe to use  on such arrays. This function is only available when compiling with GHC 8.2 or newer. primitiveCheck whether or not the mutable primitive array is pinned. This function is only available when compiling with GHC 8.2 or newer. primitive2Lazy right-associated fold over the elements of a . primitive4Strict right-associated fold over the elements of a . primitive1Lazy left-associated fold over the elements of a . primitive3Strict left-associated fold over the elements of a . primitive3Strict left-associated fold over the elements of a . primitiveTraverse a primitive array. The traversal forces the resulting values and writes them to the new primitive array as it performs the monadic effects. Consequently:traversePrimArrayP (\x -> print x $> bool x undefined (x == 2)) (fromList [1, 2, 3 :: Int])12 *** Exception: Prelude.undefinedIn many situations,  can replace , changing the strictness characteristics of the traversal but typically improving the performance. Consider the following short-circuiting traversal: incrPositiveA :: PrimArray Int -> Maybe (PrimArray Int) incrPositiveA xs = traversePrimArray (\x -> bool Nothing (Just (x + 1)) (x > 0)) xsThis can be rewritten using 7. To do this, we must change the traversal context to  MaybeT (ST s), which has a   instance: incrPositiveB :: PrimArray Int -> Maybe (PrimArray Int) incrPositiveB xs = runST $ runMaybeT $ traversePrimArrayP (\x -> bool (MaybeT (return Nothing)) (MaybeT (return (Just (x + 1)))) (x > 0)) xsBenchmarks demonstrate that the second implementation runs 150 times faster than the first. It also results in fewer allocations. primitiveFilter the primitive array, keeping the elements for which the monadic predicate evaluates to true. primitiveMap over the primitive array, keeping the elements for which the monadic predicate provides a . primitiveGenerate a primitive array by evaluating the monadic generator function at each index. primitiveExecute the monadic action the given number of times and store the results in a primitive array. primitive+Map over the elements of a primitive array. primitive3Indexed map over the elements of a primitive array. primitive>Filter elements of a primitive array according to a predicate. primitiveFilter the primitive array, keeping the elements for which the monadic predicate evaluates true. primitiveMap over the primitive array, keeping the elements for which the applicative predicate provides a . primitiveMap over a primitive array, optionally discarding some elements. This has the same behavior as Data.Maybe.mapMaybe. primitiveTraverse a primitive array. The traversal performs all of the applicative effects before forcing the resulting values and writing them to the new primitive array. Consequently:traversePrimArray (\x -> print x $> bool x undefined (x == 2)) (fromList [1, 2, 3 :: Int])123 *** Exception: Prelude.undefined The function 6 always outperforms this function, but it requires a   constraint, and it forces the values as it performs the effects. primitive:Traverse a primitive array with the index of each element. primitiveTraverse a primitive array with the indices. The traversal forces the resulting values and writes them to the new primitive array as it performs the monadic effects. primitiveGenerate a primitive array. primitiveCreate a primitive array by copying the element the given number of times. primitiveGenerate a primitive array by evaluating the applicative generator function at each index. primitiveExecute the applicative action the given number of times and store the results in a . primitiveTraverse the primitive array, discarding the results. There is no   variant of this function, since it would not provide any performance benefit. primitiveTraverse the primitive array with the indices, discarding the results. There is no   variant of this function, since it would not provide any performance benefit. primitive Create a pinned primitive array of the specified size (in elements). The garbage collector is guaranteed not to move it. primitive Create a pinned primitive array of the specified size (in elements) and with the alignment given by its ? instance. The garbage collector is guaranteed not to move it. primitiveYield a pointer to the array's data. This operation is only safe on pinned prim arrays allocated by newPinnedByteArray or newAlignedPinnedByteArray. primitiveYield a pointer to the array's data. This operation is only safe on pinned byte arrays allocated by newPinnedByteArray or newAlignedPinnedByteArray. primitiveReturn 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. primitiveReturn a newly allocated mutable array with the specified subrange of the provided mutable array. The provided mutable array should contain the full subrange specified by the two Ints, but this is not checked. primitive:Execute the monadic action and freeze the resulting array. 4runPrimArray m = runST $ m >>= unsafeFreezePrimArray primitive primitive primitive primitive primitiveLexicographic ordering. Subject to change between major versions. primitive primitivenew size primitivenew size primitivearray primitiveindex primitiveelement primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of elements to copy primitivedestination array primitiveoffset into destination array primitive source array primitiveoffset into source array primitivenumber of elements to copy primitivedestination pointer primitive source array primitiveoffset into source array primitivenumber of elements to copy primitivedestination pointer primitive source array primitiveoffset into source array primitivenumber of elements to copy primitivedestination array primitivedestination offset primitivesource pointer primitivenumber of elements primitive array to fill primitiveoffset into array primitivenumber of values to fill primitivevalue to fill with primitivearray primitivesource primitiveoffset in elements primitivelength in elements primitivesource primitiveoffset in elements primitivelength in elements primitivelength primitive generator primitivemapping function primitiveprimitive array primitivemapping function primitiveprimitive array primitivemapping function primitiveprimitive array primitivelength primitiveelement from index primitivelength primitiveelement primitivelength primitiveelement from index primitivelength primitiveapplicative element producer primitive source array primitiveoffset into destination array primitivenumber of elements to copy primitive source array primitiveoffset into destination array primitivenumber of elements to copy>> (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNone primitive1Offset a pointer by the given number of elements. primitiveSubtract a pointer from another pointer. The result represents the number of elements of type a that fit in the contiguous memory range bounded by these two pointers. primitiveRead a value from a memory position given by a pointer 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. primitiveRead 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. primitiveWrite 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. primitive2Copy the given number of elements from the second * to the first. The areas may not overlap. primitive2Copy the given number of elements from the second & to the first. The areas may overlap. primitiveFill a memory block with the given value. The length is in elements of type a rather than in bytes. primitivedestination pointer primitivesource pointer primitivenumber of elements primitivedestination pointer primitivesource pointer primitivenumber of elements   (c) Roman Leshchinskiy 2009-2012 BSD-style'Roman Leshchinskiy  non-portableNoneʻ=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                (primitive-0.7.4.0-Jn1nYXToEHPK8exID3XEUlData.Primitive.ArrayData.Primitive.ByteArrayControl.Monad.PrimitiveData.Primitive.TypesData.Primitive.PtrData.Primitive.MVarData.Primitive.MachDepsData.Primitive.MutVarData.Primitive.SmallArrayData.Primitive.PrimArrayControl.ExceptionevaluateControl.Monad.Trans.ListListT"Data.Primitive.Internal.OperationsMVarData PrimitiveData.PrimitiveTypesArraybaseGHC.ExtsfromList fromListNghc-primGHC.Prim ByteArray#MutableByteArray# RealWorldGHC.PtrPtrnullPtr MonadPrimBase MonadPrimPrimBaseinternal PrimMonad PrimState primitive primitive_liftPrim primToPrimprimToIOprimToSTioToPrimstToPrimunsafePrimToPrimunsafePrimToSTunsafePrimToIOunsafeSTToPrimunsafeIOToPrimunsafeInlinePrimunsafeInlineIOunsafeInlineSTtouchevalPrim noDuplicateunsafeInterleaveunsafeDupableInterleave $fPrimMonadST$fPrimMonadST0$fPrimMonadRWST$fPrimMonadWriterT$fPrimMonadStateT$fPrimMonadSelectT$fPrimMonadAccumT$fPrimMonadExceptT$fPrimMonadRWST0$fPrimMonadRWST1$fPrimMonadWriterT0$fPrimMonadWriterT1$fPrimMonadStateT0$fPrimMonadReaderT$fPrimMonadMaybeT$fPrimMonadErrorT$fPrimMonadListT$fPrimMonadIdentityT$fPrimMonadContT $fPrimMonadIO $fPrimBaseST $fPrimBaseST0$fPrimBaseIdentityT $fPrimBaseIO $fMonadPrimsm$fMonadPrimBasesm MutableArraymarray#array# sizeofArraysizeofMutableArraynewArray readArray writeArray indexArray indexArray## indexArrayM freezeArrayunsafeFreezeArray thawArrayunsafeThawArraysameMutableArray copyArraycopyMutableArray cloneArraycloneMutableArray emptyArrayrunArray createArraytraverseArrayP mapArray'arrayFromListN arrayFromList $fDataArray $fRead1Array $fReadArray $fShow1Array $fShowArray $fMonoidArray$fSemigroupArray$fMonadFixArray$fMonadZipArray$fMonadPlusArray$fMonadFailArray$fAlternativeArray$fApplicativeArray$fFunctorArray $fIsListArray$fTraversableArray$fFoldableArray $fOrd1Array $fOrdArray $fEq1Array $fEqArray $fNFDataArray$fNFData1Array$fLiftLiftedRepArray$fDataMutableArray$fEqMutableArray $fMonadArray newEmptyMVarnewMVartakeMVarreadMVarputMVar tryTakeMVar tryPutMVar tryReadMVar isEmptyMVar$fEqMVarInt64_#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_WORD64MutVar newMutVar readMutVar writeMutVaratomicModifyMutVaratomicModifyMutVar' modifyMutVar modifyMutVar' $fEqMutVarSmallMutableArray SmallArray newSmallArrayreadSmallArraywriteSmallArrayindexSmallArrayMindexSmallArrayindexSmallArray##cloneSmallArraycloneSmallMutableArrayfreezeSmallArrayunsafeFreezeSmallArraythawSmallArrayunsafeThawSmallArraycopySmallArraycopySmallMutableArraysizeofSmallArraysizeofSmallMutableArraytraverseSmallArrayPmapSmallArray' runSmallArraycreateSmallArrayemptySmallArraysmallArrayFromListNsmallArrayFromListshrinkSmallMutableArray$fDataSmallArray$fRead1SmallArray$fReadSmallArray$fShow1SmallArray$fShowSmallArray$fIsListSmallArray$fMonoidSmallArray$fSemigroupSmallArray$fMonadFixSmallArray$fMonadZipSmallArray$fMonadPlusSmallArray$fMonadFailSmallArray$fAlternativeSmallArray$fApplicativeSmallArray$fFunctorSmallArray$fTraversableSmallArray$fFoldableSmallArray$fOrdSmallArray$fOrd1SmallArray$fEqSmallArray$fEq1SmallArray$fLiftLiftedRepSmallArray$fNFDataSmallArray$fNFData1SmallArray$fDataSmallMutableArray$fEqSmallMutableArray$fMonadSmallArray PrimStorablegetPrimStorablePrimsizeOf# alignment#indexByteArray#readByteArray#writeByteArray# setByteArray# indexOffAddr# readOffAddr# writeOffAddr# setOffAddr#sizeOf alignmentdefaultSetByteArray#defaultSetOffAddr# $fPrimIntPtr $fPrimWordPtr $fPrimFunPtr$fPrimStablePtr $fPrimPtr $fPrimChar $fPrimDouble $fPrimFloat $fPrimInt64 $fPrimInt32 $fPrimInt16 $fPrimInt8 $fPrimInt $fPrimWord64 $fPrimWord32 $fPrimWord16 $fPrimWord8 $fPrimWord$fStorablePrimStorable $fPrimMax $fPrimMin $fPrimLast $fPrimFirst $fPrimProduct $fPrimSum $fPrimDual$fPrimIdentity $fPrimDown $fPrimConst$fPrimFd $fPrimCTimer $fPrimCKey $fPrimCId$fPrimCFsFilCnt$fPrimCFsBlkCnt$fPrimCClockId $fPrimCBlkCnt$fPrimCBlkSize $fPrimCRLim $fPrimCTcflag $fPrimCSpeed $fPrimCCc $fPrimCUid $fPrimCNlink $fPrimCGid $fPrimCSsize $fPrimCPid $fPrimCOff $fPrimCMode $fPrimCIno $fPrimCDev $fPrimCDouble $fPrimCFloat$fPrimCSUSeconds$fPrimCUSeconds $fPrimCTime $fPrimCClock$fPrimCUIntMax $fPrimCIntMax$fPrimCUIntPtr $fPrimCIntPtr $fPrimCBool $fPrimCULLong $fPrimCLLong$fPrimCSigAtomic $fPrimCWchar $fPrimCSize$fPrimCPtrdiff $fPrimCULong $fPrimCLong $fPrimCUInt $fPrimCInt $fPrimCUShort $fPrimCShort $fPrimCUChar $fPrimCSChar $fPrimCCharMutableByteArray ByteArray newByteArraynewPinnedByteArraynewAlignedPinnedByteArraybyteArrayContentsmutableByteArrayContentssameMutableByteArrayresizeMutableByteArraygetSizeofMutableByteArrayfreezeByteArray thawByteArrayunsafeFreezeByteArrayunsafeThawByteArraysizeofByteArraysizeofMutableByteArrayshrinkMutableByteArrayisByteArrayPinnedisMutableByteArrayPinnedindexByteArray readByteArraywriteByteArrayfoldrByteArraybyteArrayFromListbyteArrayFromListN copyByteArraycopyMutableByteArraycopyByteArrayToPtrcopyPtrToMutableByteArraycopyMutableByteArrayToPtrcopyByteArrayToAddrcopyMutableByteArrayToAddr moveByteArray setByteArray fillByteArraycompareByteArraysemptyByteArraycloneByteArraycloneMutableByteArray runByteArray$fIsListByteArray$fMonoidByteArray$fSemigroupByteArray$fOrdByteArray $fEqByteArray$fShowByteArray$fDataByteArray$fNFDataByteArray$fLiftLiftedRepByteArray$fDataMutableByteArray$fEqMutableByteArray$fNFDataMutableByteArrayMutablePrimArray PrimArrayprimArrayFromListprimArrayFromListNprimArrayToListemptyPrimArray newPrimArrayresizeMutablePrimArrayshrinkMutablePrimArray readPrimArraywritePrimArraycopyMutablePrimArray copyPrimArraycopyPrimArrayToPtrcopyMutablePrimArrayToPtrcopyPtrToMutablePrimArray setPrimArraygetSizeofMutablePrimArraysizeofMutablePrimArraysameMutablePrimArrayfreezePrimArray thawPrimArrayunsafeFreezePrimArrayunsafeThawPrimArrayindexPrimArraysizeofPrimArrayisPrimArrayPinnedisMutablePrimArrayPinnedfoldrPrimArrayfoldrPrimArray'foldlPrimArrayfoldlPrimArray'foldlPrimArrayM'traversePrimArrayPfilterPrimArrayPmapMaybePrimArrayPgeneratePrimArrayPreplicatePrimArrayP mapPrimArray imapPrimArrayfilterPrimArrayfilterPrimArrayAmapMaybePrimArrayAmapMaybePrimArraytraversePrimArrayitraversePrimArrayitraversePrimArrayPgeneratePrimArrayreplicatePrimArraygeneratePrimArrayAreplicatePrimArrayAtraversePrimArray_itraversePrimArray_newPinnedPrimArraynewAlignedPinnedPrimArrayprimArrayContentsmutablePrimArrayContentsclonePrimArraycloneMutablePrimArray runPrimArray$fMonoidPrimArray$fSemigroupPrimArray$fShowPrimArray$fIsListPrimArray$fOrdPrimArray $fEqPrimArray$fNFDataPrimArray$fLiftLiftedRepPrimArray$fNFDataMutablePrimArray$fEqMutablePrimArray advancePtr subtractPtr indexOffPtr readOffPtr writeOffPtrcopyPtrmovePtrsetPtr GHC.TypesIOGHC.STST GHC.MaybeNothingJustTrueFalsesetWideCharOffAddr#setDoubleOffAddr#setFloatOffAddr#setStablePtrOffAddr#setAddrOffAddr#setIntOffAddr#setInt64OffAddr#setInt32OffAddr#setInt16OffAddr#setInt8OffAddr#setWordOffAddr#setWord64OffAddr#setWord32OffAddr#setWord16OffAddr#setWord8OffAddr#setWideCharArray#setDoubleArray#setFloatArray#setStablePtrArray# setAddrArray# setIntArray#setInt64Array#setInt32Array#setInt16Array# setInt8Array# setWordArray#setWord64Array#setWord32Array#setWord16Array#setWord8Array#Data.Functor.IdentityIdentity?Foreign.StorableStorableGHC.WordWord8DoubleCharIntWord