HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Writing integers to a buffer

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

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

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.