HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleblaze-builder-0.4.4.1Haskell98

Blaze.ByteString.Builder.Int

Writes and Builders for serializing integers.

See Blaze.ByteString.Builder.Word for information about how to best write several integers at once.

  • 33 values

Writing integers to a buffer

1 declaration

Big-endian writes

Little-endian writes

Host-endian writes

valuewriteInthost :: Int -> Write
#

Write a single native machine Int. The Int is written in host order, host endian form, for the machine you're on. On a 64 bit machine the Int is an 8 byte value, on a 32 bit machine, 4 bytes. Values written this way are not portable to different endian or integer sized machines, without conversion.

Creating builders from integers

2 declarations

We provide serialization functions both for singleton integers as well as for lists of integers. Using these list serialization functions is much faster than using mconcat . map fromInt<n>, as the list serialization functions use a tighter inner loop.

Big-endian serialization

Little-endian serialization

Host-endian serialization

valuefromInthost :: Int -> Builder
#

Serialize a single native machine Int. The Int is serialized in host order, host endian form, for the machine you're on. On a 64 bit machine the Int is an 8 byte value, on a 32 bit machine, 4 bytes. Values written this way are not portable to different endian or integer sized machines, without conversion.