type Array = ByteArray
Immutable array type.
License : BSD-style Maintainer : bos@serpentine.com Portability : portable
Packed, unboxed, heap-resident arrays. Suitable for performance critical use, both in terms of large data quantities and high speed.
This module is intended to be imported qualified, to avoid name
clashes with Prelude functions, e.g.
import qualified Data.Text.Array as A
The names in this module resemble those in the Array family
of modules, but are shorter due to the assumption of qualified
naming.
type Array = ByteArrayImmutable array type.
ByteArray :: ByteArray# -> ByteArraytype MArray = MutableByteArrayMutable array type, for use in the ST monad.
MutableByteArray :: (MutableByteArray# s) -> MutableByteArray sresizeM :: MArray s -> Int -> ST s (MArray s)shrinkM :: MArray s -> Int -> ST s ()copyM :: MArray s -> Int -> MArray s -> Int -> Int -> ST s ()Copy some elements of a mutable array.
Destination
Source
IntDestination offset
IntSource offset
IntCount
copyI :: Int -> MArray s -> Int -> Array -> Int -> ST s ()Copy some elements of an immutable array.
Destination
IntCount
IntDestination offset
ArraySource
IntSource offset
copyFromPointer :: MArray s -> Int -> Ptr Word8 -> Int -> ST s ()Copy from pointer.
Destination
Source
IntDestination offset
IntCount
copyToPointer :: Array -> Int -> Ptr Word8 -> Int -> ST s ()Copy to pointer.
Destination
ArraySource
IntSource offset
IntCount
empty :: ArrayAn empty immutable array.
equal :: Array -> Int -> Array -> Int -> Int -> BoolCompare portions of two arrays for equality. No bounds checking is performed.
ArrayFirst array
IntOffset in the first array
ArraySecond array
IntOffset in the second array
IntHow many bytes to compare?
compare :: Array -> Int -> Array -> Int -> Int -> OrderingCompare portions of two arrays. No bounds checking is performed.
ArrayFirst array
IntOffset in the first array
ArraySecond array
IntOffset in the second array
IntHow many bytes to compare?
run :: (forall s. ST s (MArray s)) -> ArrayRun an action in the ST monad and return an immutable array of its result.
run2 :: (forall s. ST s (MArray s, a)) -> (Array, a)Run an action in the ST monad and return an immutable array of its result paired with whatever else the action returns.
toList :: Array -> Int -> Int -> [Word8]Convert an immutable array to a list.
unsafeFreeze :: MArray s -> ST s ArrayFreeze a mutable array. Do not mutate the MArray afterwards!
unsafeIndex :: Array -> Int -> Word8Unchecked read of an immutable array. May return garbage or crash on an out-of-bounds access.
new :: forall s. Int -> ST s (MArray s)Create an uninitialized mutable array.
newPinned :: forall s. Int -> ST s (MArray s)Create an uninitialized mutable pinned array.
newFilled :: Int -> Int -> ST s (MArray s)unsafeWrite :: MArray s -> Int -> Word8 -> ST s ()Unchecked write of a mutable array. May return garbage or crash on an out-of-bounds access.
tile :: MArray s -> Int -> ST s ()getSizeofMArray :: MArray s -> ST s IntCommunity contribution. The service has not verified this documentation. The generator reported 2 diagnostics.
Target: Linux on x86-64. Some inferred types and resolved links are not available.
Generator: aihc-haddock-858b1951-web-1
Metadata snapshot: 0b0724abd14577f7a6c8172d62e3e1c0808feb114d4d379402e17f37e3c7801e
Open the dependency plan · Download the documentation model