cqrs-types-0.9.0: Command-Query Responsibility Segregation. Modules for the basic types.

Safe HaskellNone

Data.CQRS.Serializable

Description

Serialization support. This is mainly used for compatibility with whatever serialization library you want to use.

Synopsis

Documentation

class Serializable a whereSource

Serialization support for values of type a.

Methods

serialize :: a -> ByteStringSource

Serialize a value. The serialized representation should contain some metadata (a UUID for example) which can be used to check reliably whether the encoded representation is semantically valid upon decoding.

deserialize :: ByteString -> Maybe aSource

De-serialize a value from a byte string. Should return Nothing if decoding is not possible due to a now-invalid representation.

Instances

Serializable GUID

Serialize instance.