Lifted wrapper for ByteArray#.
Since ByteArray# is an unlifted type and not a member of kind Type,
things like [ByteArray#] or IO ByteArray# are ill-typed. To work around this
inconvenience this module provides a standard lifted wrapper, inhabiting Type.
Clients are expected to use ByteArray in higher-level APIs,
but wrap and unwrap ByteArray internally as they please
and use functions from GHC.Exts.
The memory representation of a ByteArray is:
╭─────────────┬───╮ ╭────────┬──────┬─────────╮
│ Constructor │ * ┼─►│ Header │ Size │ Payload │
╰─────────────┴───╯ ╰────────┴──────┴─────────╯And its overhead is the following:
ByteArray constructor: 1 word
Pointer to ByteArray#: 1 word
ByteArray# Header: 1 word
ByteArray# Size: 1 word
Where a word is the unit of heap allocation, measuring 8 bytes on 64-bit systems, and 4 bytes on 32-bit systems.
Constructors
Instances9IsList, Eq, Data, Ord, Show, Semigroup, …
IsList ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteEq ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteData ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteOrd ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteNon-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.
Show ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteSemigroup ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteMonoid ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteLift ByteArrayDefined in base-4.23.0.0 · Data.Array.Bytetype Item ByteArray = Word8Defined in base-4.23.0.0 · Data.Array.Byte