h,O:J      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi jkl mnopqr stuvwxyz{|}~       "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy      "(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 55A 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)e: the element type of the array. Only certain element types are supported.An  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 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.1Returns the bounds of the array (lowest,highest).,Returns the number of elements in the array.Builds a new array, with every element initialised to the supplied value. The first and second element of the tuple specifies the lowest and highest index, respectively.Builds 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. The first and second element of the tuple specifies the lowest and highest index, respectively.Builds a new array, with every element initialised to an undefined value. The first and second element of the tuple specifies the lowest and highest index, respectively.,Arrays with unboxed elements. Instances of  are provided for  with certain element types (, , , etc.; see the  class for a full list).A  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 UArray to get the benefits of unboxed arrays (don't forget to import Data.Array.Unboxed instead of  Data.Array).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+Constructs 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 x. 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, + is strict in the bounds argument and in the indices of the association list. Whether array 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.,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.-array9Constructs an immutable array using a generator function.0Returns the element of an immutable array at the specified index, or throws an exception if the index is out of bounds.1arrayReturns ? the element of an immutable array at the specified index, or  if the index is out of bounds.24Returns a list of all the valid indices in an array.3Returns a list of all the elements of an array, in the same order as their indices.4;Returns the contents of an array as a list of associations.5Constructs 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.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: hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b hist bnds is = accumArray (+) 0 bnds [(i, 1) | i\<-is, inRange bnds i]6Takes 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.7accum f takes an array and an association list and accumulates pairs from the list into the array with the accumulating function f. Thus 5 can be defined using 7: =accumArray f z b = accum f (array b [(i, z) | i \<- range b])8Returns a new array derived from the original array by applying a function to each of the elements.9Returns a new array derived from the original array by applying a function to each of the indices.:arrayLazy right-associative fold.;array*Strict accumulating left-associative fold.<arrayLazy left-associative fold.=array+Strict accumulating right-associative fold.>arrayMap elements to applicative actions, sequence them left-to-right, and discard the results.?array forArray_ is > with its arguments flipped.@array2Strict accumulating left-associative monadic fold.Aarray3Strict accumulating right-associative monadic fold.NConstructs 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. The first and second element of the tuple specifies the lowest and highest index, respectively.OarrayConstructs a mutable array using a generator function. It invokes the generator function in ascending order of the indices.P$Read an element from a mutable arrayQ#Write an element in a mutable arrayRarray$Modify an element in a mutable arraySarrayModify an element in a mutable array. Strict in the written element.T4Return a list of all the elements of a mutable arrayUReturn a list of all the associations of a mutable array, in index order.VConstructs a new array derived from the original array by applying a function to each of the elements.WConstructs a new array derived from the original array by applying a function to each of the indices.Xarray*Strict accumulating left-associative fold.Yarray+Strict accumulating right-associative fold.Zarray2Strict accumulating left-associative monadic fold.[array3Strict accumulating right-associative monadic fold.\arrayMap elements to monadic actions, sequence them left-to-right, and discard the results.]array forMArrayM_ is \ with its arguments flipped.d&The index of the word which the given Bool array elements falls within.g*Converts a mutable array (any instance of *) to an immutable array (any instance of #) by taking a complete copy of it.iConverts 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 i. Because the optimised versions are enabled by specialisations, you will need to compile with optimisation (-O) to get them. ->  ->  ->   ->  j-Converts an immutable array (any instance of )) into a mutable array (any instance of #) by taking a complete copy of it.lConverts 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 l. Because the optimised versions are enabled by specialisations, you will need to compile with optimisation (-O) to get them. ->  ->   ->   -> r 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...).+%bounds of the array: (lowest,highest)list of associations5An accumulating functionA default elementThe bounds of the arrayList of associationsReturns: the arraytus016758M+4edf_rIHa3Gb<;@XZ:=AY[?]gph-UT29,./VW\%$RSONLPK'&cJjok>*F)EBiqC^(Dlnm`Q"# !"!# tsu&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh%ijk$lmnopqr"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental#non-portable (uses Data.Array.Base) Trustworthy7T016758+43<;@:=A?-29,>+,5-01234:;<=>?@A6789'(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:H'Mutable, unboxed, strict arrays in the , monad. The type arguments are as follows: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: see Data.Array.MArray for a list of instances. 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...).  "(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;!XZY[]gUTVW\RSONPjQNOPQRSXY\]Z[VWTUgj"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) Trustworthy =Reads a number of s from the specified  directly into an array.Writes an array of  to the specified .Handle to read from"Array in which to place the values Number of  s to readReturns: the number of s actually read, which might be smaller than the number requested if the end of file was reached.Handle to write toArray to write from Number of  s to writeXZY[]gUTVW\RSONPjQ  "(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>XZY[]gUTVW\ONPjQNOPQXY\]Z[VWTUgj"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)Safe?XZY[]gUTVW\ONPjQ  "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) TrustworthyBA 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  unsafeFreeze internally, but this wrapper is a safe interface to that function.A 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  unsafeFreeze internally, but this wrapper is a safe interface to that function.XZY[]gUTVW\RSONPjQ"(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)SafeCXZY[]gUTVW\ONPjQ "(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)NoneG The array type1The pointer to the array contents is obtained by . The idea is similar to  (used internally here). The pointer should be used only during execution of the 7 action retured by the function passed as argument to .3If you want to use it afterwards, ensure that you  after the last use of the pointer, so the array is not freed too early. Construct a  from an arbitrary 9. It is the caller's responsibility to ensure that the  points to an area of memory sufficient for the specified bounds. "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) TrustworthyGXZY[]gUTVW\RSONPjQ"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray) TrustworthyHXZY[]gUTVW\ONPjQ"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.IArray) TrustworthyI016758+43<;@:=A?-29,> "(c) The University of Glasgow 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org experimental%non-portable (uses Data.Array.MArray)NoneJrilril  !"#$%&'()**+,-./01234"56789:;<=>?@A BCD!E#$%&'(F)GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      array-0.5.8.0-b385 Data.Array.ST Data.Array Data.Array.IOData.Array.IO.InternalsData.Array.BaseData.Array.MArrayData.Array.UnboxedData.Array.IArrayData.Array.UnsafeData.Array.StorableData.Array.Storable.InternalsArrayUArrayIOUArraySTUArrayIOArraySTArray $dmnewArray $dmnewArray_$dmunsafeAccum$dmunsafeAccumArray$dmunsafeNewArray_$dmunsafeReplaceData.Array.MArray.SafeData.Array.IO.SafeData.Array.ST.SafeData.Array.Storable.Safe ghc-internalGHC.Internal.Arrarray listArray!boundsindiceselemsassocs accumArray//accumixmapGHC.Internal.IOArrayMArray getBoundsgetNumElementsnewArray newArray_unsafeNewArray_ unsafeRead unsafeWrite ListUArrayIArray numElements unsafeArrayunsafeAt unsafeReplace unsafeAccumunsafeAccumArray memcpy_thaw memcpy_freeze safeRangeSize safeIndexunsafeReplaceST unsafeAccumSTunsafeAccumArraySTgenArray listArrayST listUArrayST!?amap foldrArray foldlArray' foldlArray foldrArray'traverseArray_ forArray_ foldlArrayM' foldrArrayM'unsafeArrayUArrayunsafeFreezeSTUArrayunsafeReplaceUArrayunsafeAccumUArrayunsafeAccumArrayUArrayeqUArray cmpUArray cmpIntUArray showsIArray readIArray nullStablePtr arrEleBottom newListArray newGenArray readArray writeArray modifyArray modifyArray'getElems getAssocsmapArray mapIndices foldlMArray' foldrMArray' foldlMArrayM' foldrMArrayM' mapMArrayM_ forMArrayM_unsafeNewArraySTUArray_ bOOL_SCALE wORD_SCALE dOUBLE_SCALE fLOAT_SCALE safe_scale bOOL_INDEXbOOL_BIT bOOL_NOT_BITfreezefreezeSTUArray unsafeFreezethaw thawSTUArray unsafeThawunsafeThawSTUArrayunsafeThawIOArray thawIOArray freezeIOArrayunsafeFreezeIOArray castSTUArray$fIArrayArraye $fReadUArray $fShowUArray $fOrdUArray $fEqUArray$fIArrayUArrayWord64$fIArrayUArrayWord32$fIArrayUArrayWord16$fIArrayUArrayWord8$fIArrayUArrayInt64$fIArrayUArrayInt32$fIArrayUArrayInt16$fIArrayUArrayInt8$fIArrayUArrayStablePtr$fIArrayUArrayDouble$fIArrayUArrayFloat$fIArrayUArrayFunPtr$fIArrayUArrayPtr$fIArrayUArrayWord$fIArrayUArrayInt$fIArrayUArrayChar$fIArrayUArrayBool$fMArraySTArrayeST$fMArraySTArrayeST0$fMArrayIOArrayeIO$fMArraySTUArrayWord64ST$fMArraySTUArrayWord32ST$fMArraySTUArrayWord16ST$fMArraySTUArrayWord8ST$fMArraySTUArrayInt64ST$fMArraySTUArrayInt32ST$fMArraySTUArrayInt16ST$fMArraySTUArrayInt8ST$fMArraySTUArrayStablePtrST$fMArraySTUArrayDoubleST$fMArraySTUArrayFloatST$fMArraySTUArrayFunPtrST$fMArraySTUArrayPtrST$fMArraySTUArrayWordST$fMArraySTUArrayIntST$fMArraySTUArrayCharST$fMArraySTUArrayBoolST $fEqSTUArray castIOUArrayunsafeThawIOUArrayunsafeFreezeIOUArray$fMArrayIOUArrayWord64IO$fMArrayIOUArrayWord32IO$fMArrayIOUArrayWord16IO$fMArrayIOUArrayWord8IO$fMArrayIOUArrayInt64IO$fMArrayIOUArrayInt32IO$fMArrayIOUArrayInt16IO$fMArrayIOUArrayInt8IO$fMArrayIOUArrayStablePtrIO$fMArrayIOUArrayDoubleIO$fMArrayIOUArrayFloatIO$fMArrayIOUArrayFunPtrIO$fMArrayIOUArrayPtrIO$fMArrayIOUArrayWordIO$fMArrayIOUArrayIntIO$fMArrayIOUArrayCharIO$fMArrayIOUArrayBoolIO $fEqIOUArray hGetArray hPutArray runSTArray runSTUArray StorableArraywithStorableArraytouchStorableArrayunsafeForeignPtrToStorableArray$fMArrayStorableArrayeIOGHC.Internal.IxIxinRangeindexrange rangeSizeGHC.Internal.STSTghc-prim GHC.TypesIntFloatCharGHC.Internal.MaybeJustNothingIOGHC.Internal.WordWord8GHC.Internal.IO.Handle.TypesHandleGHC.Internal.ForeignPtr ForeignPtr