HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulesolana-haskell-sdk-1.3.0.0GHC2021

Network.Solana.Core.Compact

Solana serializes lengths as compact-u16: a Word16 packed into 1–3 bytes, little-endian, 7 data bits per byte, with the high bit of each byte flagging a continuation byte. The third byte may only carry 2 data bits, and aliased (non-canonical) encodings are rejected when decoding. A CompactArray is a sequence serialized as its compact-u16 length followed by the serialized items.

  • 1 type
  • 7 values

Decode a compact-u16 value. Fails on encodings longer than 3 bytes, on aliased (non-canonical) encodings, on an invalid third byte, and on values exceeding Word16.

datadata CompactArray a
#

A list paired with its length, serialized (Binary put) as a compact-u16 length prefix followed by each item. Build with mkCompact.

Instances6Eq, Ord, Show, Generic, Binary, Rep