cereal-vector-0.2.0.1: Serialize instances for Data.Vector types.

Safe Haskell | None
Language | Haskell98

Data.Vector.Serialize

Contents

- Orphan instances

Description

Data.Serialize functions for Data.Vector.Generic vectors. Orphan instances are provided for Data.Vector, Data.Vector.Unboxed, Data.Vector.Storable, and Data.Vector.Primitive vectors.

The serialized format is an `Int64` representing the length of the vector, followed by the Data.Serialized contents of each element.

Note that the functions in Data.Vector.Storable.UnsafeSerialize perform much better when serialization does not need to account for host endianness and word size.

Synopsis

- genericGetVector :: (Serialize a, Vector v a) => Get (v a)
- genericPutVector :: (Serialize a, Vector v a) => Putter (v a)
- genericGetVectorWith :: Vector v a => Get a -> Get (v a)
- genericPutVectorWith :: Vector v a => Putter a -> Putter (v a)

# Documentation

genericGetVector :: (Serialize a, Vector v a) => Get (v a) Source #

Read a `Vector`.

genericPutVector :: (Serialize a, Vector v a) => Putter (v a) Source #

Write a `Vector`.

genericGetVectorWith :: Vector v a => Get a -> Get (v a) Source #

Read a `Vector` using custom `Get` for the vector's elements.

genericPutVectorWith :: Vector v a => Putter a -> Putter (v a) Source #

Write a `Vector` using custom `Putter` for the vector's elements.

# Orphan instances

Serialize a => Serialize (Vector a) Source # |
Instance details Methods put :: Putter (Vector a) Source # get :: Get (Vector a) Source #
(Serialize a, Prim a) => Serialize (Vector a) Source # |
Instance details Methods put :: Putter (Vector a) Source # get :: Get (Vector a) Source #
(Serialize a, Storable a) => Serialize (Vector a) Source # |
Instance details Methods put :: Putter (Vector a) Source # get :: Get (Vector a) Source #
(Serialize a, Unbox a) => Serialize (Vector a) Source # |
Instance details Methods put :: Putter (Vector a) Source # get :: Get (Vector a) Source #