cereal-0.5.8.3: A binary serialization library
Copyright Lennart Kolmodin Galois Inc. 2009
License BSD3-style (see LICENSE)
Maintainer Trevor Elliott <trevor@galois.com>
Stability
Portability
Safe Haskell None
Language Haskell2010

Data.Serialize

Description

Synopsis

The Serialize class

class Serialize t where Source #

If your compiler has support for the DeriveGeneric and DefaultSignatures language extensions ( ghc >= 7.2.1 ), the put and get methods will have default generic implementations.

To use this option, simply add a deriving Generic clause to your datatype and declare a Serialize instance for it without giving a definition for put and get .

Minimal complete definition

Nothing

Methods

put :: Putter t Source #

Encode a value in the Put monad.

get :: Get t Source #

Decode a value in the Get monad

Instances

Instances details
Serialize Bool Source #
Instance details

Defined in Data.Serialize

Serialize Char Source #
Instance details

Defined in Data.Serialize

Serialize Double Source #
Instance details

Defined in Data.Serialize

Serialize Float Source #
Instance details

Defined in Data.Serialize

Serialize Int Source #
Instance details

Defined in Data.Serialize

Serialize Int8 Source #
Instance details

Defined in Data.Serialize

Serialize Int16 Source #
Instance details

Defined in Data.Serialize

Serialize Int32 Source #
Instance details

Defined in Data.Serialize

Serialize Int64 Source #
Instance details

Defined in Data.Serialize

Serialize Integer Source #
Instance details

Defined in Data.Serialize

Serialize Natural Source #
Instance details

Defined in Data.Serialize

Serialize Ordering Source #
Instance details

Defined in Data.Serialize

Serialize Word Source #
Instance details

Defined in Data.Serialize

Serialize Word8 Source #
Instance details

Defined in Data.Serialize

Serialize Word16 Source #
Instance details

Defined in Data.Serialize

Serialize Word32 Source #
Instance details

Defined in Data.Serialize

Serialize Word64 Source #
Instance details

Defined in Data.Serialize

Serialize () Source #
Instance details

Defined in Data.Serialize

Serialize All Source #
Instance details

Defined in Data.Serialize

Serialize Any Source #
Instance details

Defined in Data.Serialize

Serialize ByteString Source #
Instance details

Defined in Data.Serialize

Serialize ShortByteString Source #
Instance details

Defined in Data.Serialize

Serialize ByteString Source #
Instance details

Defined in Data.Serialize

Serialize IntSet Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize [a] Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( Maybe a) Source #
Instance details

Defined in Data.Serialize

( Serialize a, Integral a) => Serialize ( Ratio a) Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( First a) Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( Last a) Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( Dual a) Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( Sum a) Source #
Instance details

Defined in Data.Serialize

Serialize a => Serialize ( Product a) Source #
Instance details

Defined in Data.Serialize

Serialize e => Serialize ( IntMap e) Source #
Instance details

Defined in Data.Serialize

Serialize e => Serialize ( Tree e) Source #
Instance details

Defined in Data.Serialize

Serialize e => Serialize ( Seq e) Source #
Instance details

Defined in Data.Serialize

( Ord a, Serialize a) => Serialize ( Set a) Source #
Instance details

Defined in Data.Serialize

( Serialize a, Serialize b) => Serialize ( Either a b) Source #
Instance details

Defined in Data.Serialize

( Serialize a, Serialize b) => Serialize (a, b) Source #
Instance details

Defined in Data.Serialize

( Serialize i, Ix i, Serialize e, IArray UArray e) => Serialize ( UArray i e) Source #
Instance details

Defined in Data.Serialize

( Serialize i, Ix i, Serialize e) => Serialize ( Array i e) Source #
Instance details

Defined in Data.Serialize

( Ord k, Serialize k, Serialize e) => Serialize ( Map k e) Source #
Instance details

Defined in Data.Serialize

( Serialize a, Serialize b, Serialize c) => Serialize (a, b, c) Source #
Instance details

Defined in Data.Serialize

( Serialize a, Serialize b, Serialize c, Serialize d) => Serialize (a, b, c, d) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d) Source #

get :: Get (a, b, c, d) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e) => Serialize (a, b, c, d, e) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e) Source #

get :: Get (a, b, c, d, e) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e, Serialize f) => Serialize (a, b, c, d, e, f) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e, f) Source #

get :: Get (a, b, c, d, e, f) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e, Serialize f, Serialize g) => Serialize (a, b, c, d, e, f, g) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e, f, g) Source #

get :: Get (a, b, c, d, e, f, g) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e, Serialize f, Serialize g, Serialize h) => Serialize (a, b, c, d, e, f, g, h) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e, f, g, h) Source #

get :: Get (a, b, c, d, e, f, g, h) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e, Serialize f, Serialize g, Serialize h, Serialize i) => Serialize (a, b, c, d, e, f, g, h, i) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e, f, g, h, i) Source #

get :: Get (a, b, c, d, e, f, g, h, i) Source #

( Serialize a, Serialize b, Serialize c, Serialize d, Serialize e, Serialize f, Serialize g, Serialize h, Serialize i, Serialize j) => Serialize (a, b, c, d, e, f, g, h, i, j) Source #
Instance details

Defined in Data.Serialize

Methods

put :: Putter (a, b, c, d, e, f, g, h, i, j) Source #

get :: Get (a, b, c, d, e, f, g, h, i, j) Source #

Serialize serialisation

encode :: Serialize a => a -> ByteString Source #

Encode a value using binary serialization to a strict ByteString.

encodeLazy :: Serialize a => a -> ByteString Source #

Encode a value using binary serialization to a lazy ByteString.

decode :: Serialize a => ByteString -> Either String a Source #

Decode a value from a strict ByteString, reconstructing the original structure.

decodeLazy :: Serialize a => ByteString -> Either String a Source #

Decode a value from a lazy ByteString, reconstructing the original structure.

expect :: ( Eq a, Serialize a) => a -> Get a Source #

Perform an action, failing if the read result does not match the argument provided.

Generic deriving

class GSerializePut f where Source #

Instances

Instances details
GSerializePut ( V1 :: Type -> Type ) Source #

Always fails to serialize

Instance details

Defined in Data.Serialize

GSerializePut ( U1 :: Type -> Type ) Source #
Instance details

Defined in Data.Serialize

Serialize a => GSerializePut ( K1 i a :: Type -> Type ) Source #
Instance details

Defined in Data.Serialize

(PutSum a, PutSum b, SumSize a, SumSize b) => GSerializePut (a :+: b) Source #
Instance details

Defined in Data.Serialize

( GSerializePut a, GSerializePut b) => GSerializePut (a :*: b) Source #
Instance details

Defined in Data.Serialize

GSerializePut a => GSerializePut ( M1 i c a) Source #
Instance details

Defined in Data.Serialize

class GSerializeGet f where Source #

Instances

Instances details
GSerializeGet ( V1 :: Type -> Type ) Source #

Always fails to deserialize

Instance details

Defined in Data.Serialize

GSerializeGet ( U1 :: Type -> Type ) Source #
Instance details

Defined in Data.Serialize

Serialize a => GSerializeGet ( K1 i a :: Type -> Type ) Source #
Instance details

Defined in Data.Serialize

(GetSum a, GetSum b, SumSize a, SumSize b) => GSerializeGet (a :+: b) Source #
Instance details

Defined in Data.Serialize

Methods

gGet :: Get ((a :+: b) a0) Source #

( GSerializeGet a, GSerializeGet b) => GSerializeGet (a :*: b) Source #
Instance details

Defined in Data.Serialize

Methods

gGet :: Get ((a :*: b) a0) Source #

GSerializeGet a => GSerializeGet ( M1 i c a) Source #
Instance details

Defined in Data.Serialize

Methods

gGet :: Get ( M1 i c a a0) Source #