Module
Data.Array.ST
- Package
- purescript-arrays
- Repository
- purescript/purescript-arrays
Helper functions for working with mutable arrays using the ST
effect.
This module can be used when performance is important and mutation is a local effect.
#STArray Source
data STArray :: Region -> Type -> Type
A reference to a mutable array.
The first type parameter represents the memory region which the array belongs to. The second type parameter defines the type of elements of the mutable array.
The runtime representation of a value of type STArray h a
is the same as that of Array a
,
except that mutation is allowed.
#unsafeFreeze Source
unsafeFreeze :: forall a h. STArray h a -> ST h (Array a)
O(1). Convert a mutable array to an immutable array, without copying. The mutable array must not be mutated afterwards.