!H7      !"#$%&'()*+,-./0123456"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy789:;   "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental+non-portable (MPTCs, uses Control.Monad.ST)None =>?@AFISXQ"arrayGA mutable array with unboxed elements, that can be manipulated in the <+ monad. The type arguments are as follows:s&: the state variable argument for the < typei8: the index type of the array (should be an instance of Ix)eO: the element type of the array. Only certain element types are supported.An h will generally be more efficient (in terms of both time and space) than the equivalent boxed version ( )) with the same element type. However, + is strict in its elements - so don't use ) if you require the non-strictness that   provides.arrayClass of mutable array types.An array type has the form (a i e) where a% is the array type constructor (kind  * -> * -> *), i* is the index type (a member of the class 7), and e is the element type.The MArray" class is parameterised over both a and e` (so that instances specialised to certain element types can be defined, in the same way as for (), and also over the type of the monad, m1, in which the mutable array will be manipulated.arrayReturns the bounds of the array=array+Returns the number of elements in the arrayarrayJBuilds a new array, with every element initialised to the supplied value.arrayBuilds a new array, with every element initialised to an undefined value. In a monadic context in which operations must be deterministic (e.g. the ST monad), the array elements are initialised to a fixed but undefined value, such as zero.>arrayJBuilds a new array, with every element initialised to an undefined value.array,Arrays with unboxed elements. Instances of  are provided for  with certain element types (?, @, A, etc.; see the  class for a full list).A Y will generally be more efficient (in terms of both time and space) than the equivalent  ( with the same element type. However, + is strict in its elements - so don't use ) if you require the non-strictness that   provides. Because the IArray interface provides operations overloaded on the type of the array, it should be possible to just change the array type being used by a program from say Array to UArrayA to get the benefits of unboxed arrays (don't forget to import Data.Array.Unboxed instead of  Data.Array).arrayClass of immutable array types.An array type has the form (a i e) where a% is the array type constructor (kind  * -> * -> *), i* is the index type (a member of the class 7), and e is the element type. The IArray" class is parameterised over both a and eH, so that instances specialised to certain element types can be defined.array)Extracts the bounds of an immutable arrayarrayWConstructs an immutable array from a pair of bounds and a list of initial associations.The bounds are specified as a pair of the lowest and highest bounds in the array respectively. For example, a one-origin vector of length 10 has bounds (1,10), and a one-origin 10 by 10 matrix has bounds ((1,1),(10,10)).%An association is a pair of the form (i,x)0, which defines the value of the array at index i to be xK. The array is undefined if any index in the list is out of bounds. If any two associations in the list have the same index, the value at that index is implementation-dependent. (In GHC, the last value specified for that index is used. Other implementations will also do this for unboxed arrays, but Haskell 98 requires that for Array& the value at such indices is bottom.)6Because the indices must be checked for these errors, W is strict in the bounds argument and in the indices of the association list. Whether arrayD is strict or non-strict in the elements depends on the array type:  , is a non-strict array type, but all of the  ` arrays are strict. Thus in a non-strict array, recurrences such as the following are possible: ?a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i \<- [2..100]])Not every index within the bounds of the array need appear in the association list, but the values associated with indices that do not appear will be undefined.If, in any dimension, the lower bound is greater than the upper bound, then the array is legal, but empty. Indexing an empty array always gives an array-bounds error, but > still yields the bounds with which the array was constructed.arrayConstructs an immutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index.arrayAReturns the element of an immutable array at the specified index.array4Returns a list of all the valid indices in an array.arrayTReturns a list of all the elements of an array, in the same order as their indices.array;Returns the contents of an array as a list of associations.arrayCConstructs an immutable array from a list of associations. Unlike T, the same index is allowed to occur multiple times in the list of associations; an accumulating function? is used to combine the values of elements with the same index.For example, given a list of values of some index type, hist produces a histogram of the number of occurrences of each index within a specified range: yhist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b hist bnds is = accumArray (+) 0 bnds [(i, 1) | i\<-is, inRange bnds i]arrayTakes an array and a list of pairs and returns an array identical to the left argument except that it has been updated by the associations in the right argument. For example, if m is a 1-origin, n by n matrix, then m//[((i,i), 0) | i <- [1..n]]5 is the same matrix, except with the diagonal zeroed. As with the  function, if any two associations in the list have the same index, the value at that index is implementation-dependent. (In GHC, the last value specified for that index is used. Other implementations will also do this for unboxed arrays, but Haskell 98 requires that for Array& the value at such indices is bottom.)*For most array types, this operation is O(n) where n is the size of the array. However, the diffarray package provides an array type for which this operation has complexity linear in the number of updates.arrayaccum fz takes an array and an association list and accumulates pairs from the list into the array with the accumulating function f. Thus  can be defined using : =accumArray f z b = accum f (array b [(i, z) | i \<- range b])arraydReturns a new array derived from the original array by applying a function to each of the elements. arraycReturns a new array derived from the original array by applying a function to each of the indices.!arrayConstructs a mutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index."array$Read an element from a mutable array#array#Write an element in a mutable array$array4Return a list of all the elements of a mutable array%arrayJReturn a list of all the associations of a mutable array, in index order.&arraygConstructs a new array derived from the original array by applying a function to each of the elements.'arrayfConstructs a new array derived from the original array by applying a function to each of the indices.Barray&The index of the word which the given Bool array elements falls within.(array*Converts a mutable array (any instance of *) to an immutable array (any instance of #) by taking a complete copy of it.)arrayConverts an mutable array into an immutable array. The implementation may either simply cast the array from one type to the other without copying the array, or it may take a full copy of the array.Note that because the array is possibly not copied, any subsequent modifications made to the mutable version of the array may be shared with the immutable version. It is safe to use, therefore, if the mutable version is never modified after the freeze operation.The non-copying implementation is supported between certain pairs of array types only; one constraint is that the array types must have identical representations. In GHC, The following pairs of array types have a non-copying O(1) implementation of ). Because the optimised versions are enabled by specialisations, you will need to compile with optimisation (-O) to get them.  ->    ->   ->   ->  *array-Converts an immutable array (any instance of )) into a mutable array (any instance of #) by taking a complete copy of it.+arrayConverts an immutable array into a mutable array. The implementation may either simply cast the array from one type to the other without copying the array, or it may take a full copy of the array.Note that because the array is possibly not copied, any subsequent modifications made to the mutable version of the array may be shared with the immutable version. It is only safe to use, therefore, if the immutable array is never referenced again in this thread, and there is no possibility that it can be also referenced in another thread. If you use an unsafeThawwriteunsafeFreeze sequence in a multi-threaded setting, then you must ensure that this sequence is atomic with respect to other threads, or a garbage collector crash may result (because the write may be writing to a frozen array).The non-copying implementation is supported between certain pairs of array types only; one constraint is that the array types must have identical representations. In GHC, The following pairs of array types have a non-copying O(1) implementation of +. Because the optimised versions are enabled by specialisations, you will need to compile with optimisation (-O) to get them.  ->    ->    ->   -> ,array Casts an  with one element type into one with a different element type. All the elements of the resulting array are undefined (unless you know what you're doing...).array%bounds of the array: (lowest,highest)arraylist of associationsarrayAn accumulating functionarrayA default elementarrayThe bounds of the arrayarrayList of associationsarrayReturns: the arrayPC>=DEFGHIJKLMNOPQRSTUV WXYZ[\]^_`a!"#$%&'bcdefgBhi(j)*k+lmnop,"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (uses Data.Array.Base) Trustworthy=789:;    '(c) The University of Glasgow 2001-2012/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (uses Data.Array.Base)None=?@AI-array'Mutable, unboxed, strict arrays in the q, monad. The type arguments are as follows:i8: the index type of the array (should be an instance of Ix)eT: the element type of the array. Only certain element types are supported: see Data.Array.MArray for a list of instances..array Casts an - with one element type into one with a different element type. All the elements of the resulting array are undefined (unless you know what you're doing...).r-s.tu"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (uses Data.Array.Base)None789:;!"#$%&'(* !"#&'$%(*"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)None F/arrayReads a number of vs from the specified w directly into an array.0arrayWrites an array of v to the specified w./arrayHandle to read fromarray"Array in which to place the valuesarray Number of v s to readarrayReturns: the number of vcs actually read, which might be smaller than the number requested if the end of file was reached.0arrayHandle to write toarrayArray to write fromarray Number of v s to write789:;!"#$%&'(*-/0-/0"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (uses Data.Array.Base) TrustworthyĹ789:;!"#$%&'(* !"#&'$%(*"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) Trustworthy789:;!"#$%&'(*-/0-/0"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)NoneSXy1arrayA safe way to create and work with a mutable array before returning an immutable array for later perusal. This function avoids copying the array before returning it - it uses  unsafeFreezeD internally, but this wrapper is a safe interface to that function.2arrayA safe way to create and work with an unboxed mutable array before returning an immutable array for later perusal. This function avoids copying the array before returning it - it uses  unsafeFreezeD internally, but this wrapper is a safe interface to that function.789:; !"#$%&'(*12 12"(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) Trustworthy֔789:; !"#$%&'(*12 12"(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)None=?@AI_3arrayThe array type4array1The pointer to the array contents is obtained by 4. The idea is similar to xR (used internally here). The pointer should be used only during execution of the q7 action retured by the function passed as argument to 4.5array3If you want to use it afterwards, ensure that you 5I after the last use of the pointer, so the array is not freed too early.6array Construct a 3 from an arbitrary x9. It is the caller's responsibility to ensure that the xB points to an area of memory sufficient for the specified bounds.3y456"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)None 789:;!"#$%&'(*345345"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) Trustworthy789:;!"#$%&'(*345345"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.IArray) Trustworthy1789:;  "(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)None)+,.6,.)+6z !"#   $ % & '  ( " # !       )  * + , - . / 0 1 2 3 4 5 6789:;<=>?@ABCDE F GHIJHIKHIL M  N O  P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x yHIz {|}~;$array-0.5.3.0-G9jUVjRAtDbD1j9Dj5Nu9D Data.Array.IO Data.Array Data.Array.STData.Array.MArrayData.Array.UnboxedData.Array.IArrayData.Array.UnsafeData.Array.StorableData.Array.BaseArrayUArrayIOUArraySTUArrayIOArraySTArrayData.Array.IO.InternalsData.Array.MArray.SafeData.Array.IO.SafeData.Array.ST.SafeData.Array.Storable.InternalsData.Array.Storable.Safebase GHC.IOArrayGHC.Arrixmapaccum// accumArrayassocselemsindices! listArrayboundsarrayMArray getBoundsnewArray newArray_IArrayamap newListArray readArray writeArraygetElems getAssocsmapArray mapIndicesfreeze unsafeFreezethaw unsafeThaw castSTUArray castIOUArray hGetArray hPutArray runSTArray runSTUArray StorableArraywithStorableArraytouchStorableArrayunsafeForeignPtrToStorableArrayIxrangeindexinRange rangeSizeGHC.STSTgetNumElementsunsafeNewArray_ghc-prim GHC.TypesIntFloatChar bOOL_INDEX unsafeWrite unsafeRead ListUArray unsafeAccum unsafeReplaceunsafeAccumArrayunsafeAt unsafeArray numElements memcpy_thaw memcpy_freeze safeRangeSize safeIndexunsafeReplaceST unsafeAccumSTunsafeAccumArrayST listArrayST listUArraySTunsafeArrayUArrayunsafeFreezeSTUArrayunsafeReplaceUArrayunsafeAccumUArrayunsafeAccumArrayUArrayeqUArray cmpUArray cmpIntUArray showsIArray nullStablePtr arrEleBottomunsafeNewArraySTUArray_ bOOL_SCALE wORD_SCALE dOUBLE_SCALE fLOAT_SCALE safe_scalebOOL_BIT bOOL_NOT_BITfreezeSTUArray thawSTUArrayunsafeThawSTUArrayunsafeThawIOArray thawIOArray freezeIOArrayunsafeFreezeIOArrayIOunsafeThawIOUArrayunsafeFreezeIOUArrayGHC.WordWord8GHC.IO.Handle.TypesHandleGHC.ForeignPtr ForeignPtr