A mutable array holding as
Modulelinear-base-0.4.0Haskell2010
Data.Array.Mutable.Unlifted.Linear
This module provides an unlifted mutable array with a pure interface. Though the array itself is unlifted, it's elements are lifted types. This is made possible by using linear types to make sure array references are single threaded through reads and writes.
Accessing out-of-bounds indices causes undefined behaviour.
This module is meant to be imported qualified.
- 1 type
- 12 values
- Packagelinear-base-0.4.0
- Exports13
- LanguageHaskell2010
- LicenceMIT
- SourceLinear.hs
Extract the underlying MutableArray#, consuming the Array# in process.
Allocate a mutable array of given size using a default value.
The size should be non-negative.
Allocate a mutable array of given size using a default value, using another Array# as a uniqueness proof.
The size should be non-negative.
Consume an Array#.
Note that we can not implement a Consumable instance because Array# is unlifted.
Copy the first mutable array into the second mutable array, starting from the given index of the source array.
It copies fewer elements if the second array is smaller than the
first. n should be within [0..size src).
copyInto n src dest:
dest[i] = src[n+i] for i < size dest, i < size src + n
Return the array elements as a lazy list.
Clone an array.