ST package:array

Mutable boxed and unboxed arrays in the ST monad.
A mutable array with unboxed elements, that can be manipulated in the ST monad. The type arguments are as follows:
  • s: the state variable argument for the ST type
  • i: 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 STUArray will generally be more efficient (in terms of both time and space) than the equivalent boxed version (STArray) with the same element type. However, STUArray is strict in its elements - so don't use STUArray if you require the non-strictness that STArray provides.
Mutable, boxed, non-strict arrays in the ST monad. The type arguments are as follows:
  • s: the state variable argument for the ST type
  • i: the index type of the array (should be an instance of Ix)
  • e: the element type of the array.
A storable array is an IO-mutable array which stores its contents in a contiguous memory block living in the C heap. Elements are stored according to the class Storable. You can obtain the pointer to the array contents to manipulate elements from languages like C. It is similar to IOUArray but slower. Its advantage is that it's compatible with C.
The array type
Construct an array from a pair of bounds and a list of values in index order.
Casts an STUArray 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...).
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.
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. The first and second element of the tuple specifies the lowest and highest index, respectively.
Casts an IOUArray 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...).
A 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.