Safe Haskell | None |
---|
Irregular 2D unboxed arrays.
The difference between this type and something like
Data.Vector (Data.Vector.Unboxed a)
is that the inner arrays have kind
#
and cannot be bottom. This ensures that we can always lookup an element
from an ArrayArray#
without performing unboxings or checking for thunks.
- data MutableArrayArray s e = MutableArrayArray (MutableArrayArray# s)
- data ArrayArray e = ArrayArray ArrayArray#
- newArrayArray :: Int -> ST s (MutableArrayArray s e)
- writeArrayArrayMut :: MutableArrayArray s (MutableByteArray s) -> Int -> MutableByteArray s -> ST s ()
- writeArrayArray :: MutableArrayArray s ByteArray -> Int -> ByteArray -> ST s ()
- readArrayArray :: MutableArrayArray s (MutableByteArray s) -> Int -> ST s (MutableByteArray s)
- indexArrayArray :: ArrayArray ByteArray -> Int -> ByteArray
- unsafeFreezeArrayArray :: MutableArrayArray s e -> ST s (ArrayArray e)
- unsafeDeepFreezeArrayArray :: forall s. MutableArrayArray s (MutableByteArray s) -> ST s (ArrayArray ByteArray)
- copyArrayArray :: MutableArrayArray s ByteArray -> Int -> ArrayArray ByteArray -> Int -> Int -> ST s ()
Documentation
data MutableArrayArray s e Source
newArrayArray :: Int -> ST s (MutableArrayArray s e)Source
Create an ArrayArray
with the given number of elements.
writeArrayArrayMut :: MutableArrayArray s (MutableByteArray s) -> Int -> MutableByteArray s -> ST s ()Source
Write a MutableByteArray
to an MutableArrayArray
.
writeArrayArray :: MutableArrayArray s ByteArray -> Int -> ByteArray -> ST s ()Source
Write a ByteArray
to a MutableArrayArray
.
readArrayArray :: MutableArrayArray s (MutableByteArray s) -> Int -> ST s (MutableByteArray s)Source
Read a MutableByteArray
from a MutableArrayArray
.
indexArrayArray :: ArrayArray ByteArray -> Int -> ByteArraySource
Index an ArrayArray
of ByteArray
s.
unsafeFreezeArrayArray :: MutableArrayArray s e -> ST s (ArrayArray e)Source
Freeze a MutableArrayArray
into a plain ArrayArray
.
unsafeDeepFreezeArrayArray :: forall s. MutableArrayArray s (MutableByteArray s) -> ST s (ArrayArray ByteArray)Source
Freeze a nested MutableArrayArray
into an ArrayArray
.
copyArrayArray :: MutableArrayArray s ByteArray -> Int -> ArrayArray ByteArray -> Int -> Int -> ST s ()Source
Copy an ArrayArray