HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

  • Packagecereal-0.5.8.3
  • Exports48
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePut.hs

The Put type

typetype Put = PutM ()

Put merely lifts Builder into a Writer monad, applied to ().

newtypenewtype PutM a

The PutM type. A Writer monad over the efficient Builder monoid.

Constructors

Instances5Monad, Functor, Applicative, Semigroup, Monoid
  • Monad PutMDefined in cereal-0.5.8.3 · Data.Serialize.Put
  • Functor PutMDefined in cereal-0.5.8.3 · Data.Serialize.Put
  • Applicative PutMDefined in cereal-0.5.8.3 · Data.Serialize.Put
  • Semigroup (PutM ())Defined in cereal-0.5.8.3 · Data.Serialize.Put
  • Monoid (PutM ())Defined in cereal-0.5.8.3 · Data.Serialize.Put

Flushing the implicit parse state

valueflush :: Put

Pop the ByteString we have constructed so far, if any, yielding a new chunk in the result ByteString.

Primitives

An efficient primitive to write a strict ByteString into the output buffer. It flushes the current buffer, and writes the argument into a new chunk.

Big-endian primitives

Little-endian primitives

Host-endian, unaligned writes

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

O(1). Write a Word64 in native host order On a 32 bit machine we write two host order Word32s, in big endian form. For portability issues see putWordhost.

O(1). 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 int sized machines, without conversion.

O(1). Write a Int64 in native host order On a 32 bit machine we write two host order Int32s, in big endian form. For portability issues see putInthost.

Containers