HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulebase-4.23.0.0Haskell2010

Data.Array.Byte

Derived from primitive package.

  • 2 types
  • Packagebase-4.23.0.0
  • Exports2
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceByte.hs
datadata ByteArray
#

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:

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.Byte
  • Eq ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte
  • Data ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte
  • Ord ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte

    Non-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.Byte
  • Semigroup ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte
  • Monoid ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte
  • Lift ByteArrayDefined in base-4.23.0.0 · Data.Array.Byte
  • type Item ByteArray = Word8Defined in base-4.23.0.0 · Data.Array.Byte
datadata MutableByteArray s
#

Lifted wrapper for MutableByteArray#.

Since MutableByteArray# is an unlifted type and not a member of kind Type, things like [MutableByteArray#] or IO MutableByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting Type. Clients are expected to use MutableByteArray in higher-level APIs, but wrap and unwrap MutableByteArray internally as they please and use functions from GHC.Exts.

Instances2Eq, Data