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.Compat.Write

Conversions from the new Prims to the old Writes.

  • 1 type
  • 2 values
datadata Write
#

A write of a bounded number of bytes.

When defining a function write :: a -> Write for some a, then it is important to ensure that the bound on the number of bytes written is data-independent. Formally,

 forall x y. getBound (write x) = getBound (write y)

The idea is that this data-independent bound is specified such that the compiler can optimize the check, if there are enough free bytes in the buffer, to a single subtraction between the pointer to the next free byte and the pointer to the end of the buffer with this constant bound of the maximal number of bytes to be written.

Instances2Semigroup, Monoid
  • Semigroup WriteDefined in blaze-builder-0.4.4.1 · Blaze.ByteString.Builder.Internal.Write
  • Monoid WriteDefined in blaze-builder-0.4.4.1 · Blaze.ByteString.Builder.Internal.Write