Constructors
Array (Array# a)
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulelinear-base-0.4.0Haskell2010
Array (Array# a)Allocate a constant array given a size and an initial value The size must be non-negative, otherwise this errors.
Allocate a constant array given a size and an initial value, using another array as a uniqueness proof.
Allocate an array from a list
Sets the value of an index. The index should be less than the arrays size, otherwise this errors.
Same as set, but does not do bounds-checking. The behaviour is undefined if an out-of-bounds index is provided.
Resize an array. That is, given an array, a target size, and a seed value; resize the array to the given size using the seed value to fill in the new cells when necessary and copying over all the unchanged cells.
Target size should be non-negative.
let b = resize n x a,
then size b = n,
and b[i] = a[i] for i < size a,
and b[i] = x for size a <= i < n.
Get the value of an index. The index should be less than the arrays size, otherwise this errors.
Same as get, but does not do bounds-checking. The behaviour is undefined if an out-of-bounds index is provided.
Copy a slice of the array, starting from given offset and copying given number of elements. Returns the pair (oldArray, slice).
Start offset + target size should be within the input array, and both should be non-negative.
let b = slice i n a,
then size b = n,
and b[j] = a[i+j] for 0 <= j < n
Return the array elements as a lazy list.