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

Moduledata-serializer-0.3.5Haskell2010

Data.Serializer

Serialization monoid and serializable types.

Contents
  1. Serialization monoid
  2. Binary words serialization
  3. Endian serializers
  4. Serializable types
Synopsis

Serialization monoid

classclass (Semigroup s, Monoid s) => Serializer s where

Serialization monoid.

Methods

Instances7Serializer, …
newtypenewtype BinarySerializer

A wrapper around the Put monoid (to avoid orphan instances).

Instances5Generic, Semigroup, Monoid, Serializer, Rep
newtypenewtype CerealSerializer

A wrapper around the Put monoid (to avoid orphan instances).

Instances5Generic, Semigroup, Monoid, Serializer, Rep

Binary words serialization

valueword :: Serializer s => Word -> s

Serialize an unsigned native-sized integer in serializer default byte order.

valueint :: Serializer s => Int -> s

Serialize a signed native-sized integer in serializer default byte order.

Endian serializers

newtypenewtype LittleEndianSerializer s

Serializer wrapper with little endian default byte order.

Instances6Data, Generic, Semigroup, Monoid, Serializer, Rep
newtypenewtype BigEndianSerializer s

Serializer wrapper with big endian default byte order.

Instances6Data, Generic, Semigroup, Monoid, Serializer, Rep

Serializable types

classclass Serializable α where

Serializable type. put must work under assumption that it will be followed by more output.

Methods

Instances16Serializable, …
classclass Serializable α => SizedSerializable α where

Types with fixed serialized size.

Methods

Instances12SizedSerializable, …
classclass RestSerializable α where

Serializable type. putRest must work under assumption that it will not be followed by any more output.

Methods

Instances6RestSerializable