úÎÜ#Őt:      !"#$%&'()*+,-./0123456789 +non-portable (MPTCs, uses Control.Monad.ST) experimentallibraries@haskell.orgS:;BA 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 < type  i8: the index type of the array (should be an instance of Ix)  e=: the element type of the array. Only certain element types  are supported. An 9 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. =Class 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 >), and e is the element type. The MArray" class is parameterised over both a and e (so that Finstances specialised to certain element types can be defined, in the same way as for (), and also over the type of the monad, m, 0in which the mutable array will be manipulated.  Returns the bounds of the array ?,Returns the number of elements in the array DBuilds a new array, with every element initialised to the supplied  value. 9Builds 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. @CBuilds a new array, with every element initialised to an undefined  value. AB,Arrays with unboxed elements. Instances of  are provided  for  with certain element types (C, D, E,  etc.; see the  class for a full list). A 9 will generally be more efficient (in terms of both time  and space) than the equivalent Data.Array.Array with the same  element type. However,  is strict in its elements - so  don't use ( if you require the non-strictness that  Data.Array.Array provides.  Because the IArray- interface provides operations overloaded on A the type of the array, it should be possible to just change the - array type being used by a program from say Array to UArray to ( get the benefits of unboxed arrays (don't forget to import  Data.Array.Unboxed instead of  Data.Array). FG Class 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 >), and e is the element type. The IArray class is parameterised over both a and e#, so that instances specialised to &certain element types can be defined. *Extracts the bounds of an immutable array HIJKLMNOPQRBConstructs an immutable array from a pair of bounds and a list of initial associations. GThe bounds are specified as a pair of the lowest and highest bounds in Gthe 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), which defines the value of the array at index i to be x'. The array is undefined if any index Hin the list is out of bounds. If any two associations in the list have Ethe same index, the value at that index is implementation-dependent. :(In GHC, the last value specified for that index is used. HOther 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,  is Dstrict in the bounds argument and in the indices of the association list. Whether array1 is strict or non-strict in the elements depends on the array type: Data.Array.Array! is a non-strict array type, but  all of the Data.Array.Unboxed.UArray arrays are strict. Thus in a Bnon-strict array, recurrences such as the following are possible:  A a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i \<- [2..100]]) BNot every index within the bounds of the array need appear in the Eassociation list, but the values associated with indices that do not appear will be undefined. GIf, in any dimension, the lower bound is greater than the upper bound, Cthen 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. &bounds of the array: (lowest,highest) list of associations ?Constructs 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. STBReturns the element of an immutable array at the specified index. 5Returns a list of all the valid indices in an array. BReturns a list of all the elements of an array, in the same order  as their indices. <Returns the contents of an array as a list of associations. CConstructs an immutable array from a list of associations. Unlike @, 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. FFor 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: 4 hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b H hist bnds is = accumArray (+) 0 bnds [(i, 1) | i\<-is, inRange bnds i] An accumulating function A default element The bounds of the array List of associations Returns: the array ETakes an array and a list of pairs and returns an array identical to Fthe left argument except that it has been updated by the associations Hin the right argument. For example, if m is a 1-origin, n by n matrix, then m//[((i,i), 0) | i <- [1..n]]! is the same matrix, except with the diagonal zeroed.  As with the 4 function, if any two associations in the list have Ethe same index, the value at that index is implementation-dependent. :(In GHC, the last value specified for that index is used. HOther 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 Eof the array. However, the diffarray package provides an array type Ifor which this operation has complexity linear in the number of updates. accum f> 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]) BReturns a new array derived from the original array by applying a # function to each of the elements. !BReturns a new array derived from the original array by applying a " function to each of the indices. UVWXYZ[\]^_`a"<Constructs 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. #%Read an element from a mutable array $$Write an element in a mutable array %5Return a list of all the elements of a mutable array &=Return a list of all the associations of a mutable array, in  index order. 'EConstructs a new array derived from the original array by applying a # function to each of the elements. (EConstructs a new array derived from the original array by applying a " function to each of the indices. bcdefghijk)*Converts a mutable array (any instance of ) to an " immutable array (any instance of ) by taking a complete  copy of it. l*9Converts an mutable array into an immutable array. The 8 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. CNote that because the array is possibly not copied, any subsequent A modifications made to the mutable version of the array may be H shared with the immutable version. It is safe to use, therefore, if E the mutable version is never modified after the freeze operation. BThe non-copying implementation is supported between certain pairs D of array types only; one constraint is that the array types must C have identical representations. In GHC, The following pairs of 9 array types have a non-copying O(1) implementation of  *1. Because the optimised versions are enabled by G specialisations, you will need to compile with optimisation (-O) to  get them.  Data.Array.IO.IOUArray -> Data.Array.Unboxed.UArray  Data.Array.ST.STUArray -> Data.Array.Unboxed.UArray  Data.Array.IO.IOArray -> Data.Array.Array  Data.Array.ST.STArray -> Data.Array.Array +-Converts an immutable array (any instance of  ) into a  mutable array (any instance of ) by taking a complete copy  of it. m,8Converts an immutable array into a mutable array. The 8 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. CNote that because the array is possibly not copied, any subsequent A modifications made to the mutable version of the array may be ? shared with the immutable version. It is only safe to use, G therefore, if the immutable array is never referenced again in this F thread, and there is no possibility that it can be also referenced / in another thread. If you use an unsafeThawwrite unsafeFreeze C sequence in a multi-threaded setting, then you must ensure that G this sequence is atomic with respect to other threads, or a garbage E collector crash may result (because the write may be writing to a  frozen array). BThe non-copying implementation is supported between certain pairs D of array types only; one constraint is that the array types must C have identical representations. In GHC, The following pairs of 9 array types have a non-copying O(1) implementation of  ,1. Because the optimised versions are enabled by G specialisations, you will need to compile with optimisation (-O) to  get them.  Data.Array.Unboxed.UArray -> Data.Array.IO.IOUArray  Data.Array.Unboxed.UArray -> Data.Array.ST.STUArray  Data.Array.Array -> Data.Array.IO.IOArray  Data.Array.Array -> Data.Array.ST.STArray nopqr- Casts an ' with one element type into one with a B different element type. All the elements of the resulting array ( are undefined (unless you know what you're doing...). S:;=?@ABFGHIJKLMNOPQRST !UVWXYZ[\]^_`a"#$%&'(bcdefghijk)l*+m,nopqr-S:;==?@AB?@ABFFGHIJKLMHIJKLMNOPQRST !UVWXYZ[\]^_`a"#$%&'(bcdefghijk)l*+m,nopqr-#non-portable (uses Data.Array.Base) experimentallibraries@haskell.org>stuv"#$%&'()*+,"#$'(%&)*+,#non-portable (uses Data.Array.Base) experimentallibraries@haskell.org.'Mutable, unboxed, strict arrays in the w monad. The type  arguments are as follows:  i8: the index type of the array (should be an instance of >)  e=: the element type of the array. Only certain element types  are supported: see Data.Array.MArray for a list of instances. /x0 Casts an /.' with one element type into one with a B different element type. All the elements of the resulting array ( are undefined (unless you know what you're doing...). 1yz{./01./01.//01%non-portable (uses Data.Array.MArray) experimentallibraries@haskell.org|}2Reads a number of ~s from the specified  directly  into an array. Handle to read from #Array in which to place the values  Number of ~ s to read Returns: the number of ~ s actually 8 read, which might be smaller than the number requested ! if the end of file was reached. 3Writes an array of ~ to the specified . Handle to write to Array to write from  Number of ~ s to write €>stuv"#$%&'()*+,.023.02323%non-portable (uses Data.Array.MArray) experimentallibraries@haskell.org4GA safe way to create and work with a mutable array before returning an B immutable array for later perusal. This function avoids copying ) the array before returning it - it uses * internally, but 4 this wrapper is a safe interface to that function. 5CA safe way to create and work with an unboxed mutable array before @ returning an immutable array for later perusal. This function 8 avoids copying the array before returning it - it uses  *5 internally, but this wrapper is a safe interface to  that function. >stuv"#$%&'()*+,-4545-45%non-portable (uses Data.Array.MArray) experimentallibraries@haskell.org6The array type 71The pointer to the array contents is obtained by 7.  The idea is similar to ‚ (used internally here). 9 The pointer should be used only during execution of the w action / retured by the function passed as argument to 7. 82If you want to use it afterwards, ensure that you  8$ after the last use of the pointer, & so the array is not freed too early. 9 Construct a 6 from an arbitrary ‚ . It is  the caller'$s responsibility to ensure that the ‚ points to 8 an area of memory sufficient for the specified bounds. >stuv"#$%&'()*+,678967896789portable provisionallibraries@haskell.org> stuv  #non-portable (uses Data.Array.Base) experimentallibraries@haskell.org> stuv !  !%non-portable (uses Data.Array.IArray) experimentallibraries@haskell.org> stuv !ƒ                      !           "  # $ % & ' ( ) * + , - .//0123456789 : ; <=  > ? @ A BCDECDFCDG  H I J K L 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 wCDxyz{|}~ € ‚ƒ6 „…† array-0.3.0.0Data.Array.IO.Internals Data.Array Data.Array.STData.Array.MArrayData.Array.UnboxedData.Array.IArray Data.Array.IOData.Array.StorableData.Array.Basebase GHC.IOArrayIOArrayGHC.Arrixmapaccum// accumArrayassocselemsindices! listArrayboundsarrayArraySTArraySTUArrayMArray getBoundsnewArray newArray_UArrayIArrayamap newListArray readArray writeArraygetElems getAssocsmapArray mapIndicesfreeze unsafeFreezethaw unsafeThaw castSTUArrayIOUArray castIOUArrayunsafeThawIOUArray hGetArray hPutArray runSTArray runSTUArray StorableArraywithStorableArraytouchStorableArrayunsafeForeignPtrToStorableArray memcpy_thaw memcpy_freezeGHC.STSTIxgetNumElementsunsafeNewArray_ unsafeRead unsafeWriteghc-prim GHC.TypesIntFloatChar ListUArray numElements unsafeArrayunsafeAt unsafeReplace unsafeAccumunsafeAccumArray safeRangeSize safeIndexunsafeReplaceST unsafeAccumSTunsafeAccumArrayST listArrayST listUArraySTuArrayTcunsafeArrayUArrayunsafeFreezeSTUArrayunsafeReplaceUArrayunsafeAccumUArrayunsafeAccumArrayUArrayeqUArray cmpUArray cmpIntUArray showsIArray nullStablePtr arrEleBottom newArrayImpl stUArrayTcunsafeNewArraySTUArray_ bOOL_SCALEbOOL_WORD_SCALE wORD_SCALE dOUBLE_SCALE fLOAT_SCALE bOOL_INDEXbOOL_BIT bOOL_NOT_BITfreezeSTUArray thawSTUArrayunsafeThawSTUArrayunsafeThawIOArray thawIOArray freezeIOArrayunsafeFreezeIOArray rangeSizeinRangeindexrangeIO iOUArrayTc thawIOUArrayunsafeFreezeIOUArrayfreezeIOUArray memcpy_ptr_ba memcpy_ba_ptrGHC.WordWord8GHC.IO.Handle.TypesHandleillegalBufferSizeGHC.ForeignPtr ForeignPtr