HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

Modulesolana-haskell-sdk-1.3.0.0GHC2021

Network.Solana.Core.Borsh

This module provides helpers for Borsh serialization, which differs from Bincode in specific length encodings and enum tag widths. Both enforce strict 0/1 validation for Option tags and Bool encoding:

  • String lengths: Borsh uses 32-bit LE (u32), Bincode uses 64-bit LE (u64).

  • Vec counts: Borsh uses 32-bit LE (u32), Bincode uses 64-bit LE (u64).

  • Enum tags: Borsh uses 8-bit (u8), Bincode uses 32-bit LE (u32).

Synopsis

Deserialize a String in Borsh format: u32 LE byte-length + UTF-8 bytes. Fails if the length exceeds maxBound :: Int or if the bytes are not valid UTF-8.

valuegetBorshVec :: Get a -> Get [a]

Deserialize a list in Borsh format: u32 LE count + elements. Fails if the count exceeds maxBound :: Int.