data-layout-0.1.0.0: Read/write arbitrary binary layouts to a "Data.Vector.Storable".

Safe HaskellNone

Data.Layout.Vector

Synopsis

Documentation

data Codec Source

Contains the information required to encode or decode a Vector from its arbitrary layout in a strict ByteString.

compile :: Layout -> CodecSource

Compiles a data layout in to a codec capable of encoding and decoding data stored in the layout.

data StorableVector whereSource

Abstracts over vectors of storable types to allow calling encodeVectors. The SV constructor provides proof that the Vector contains Storable elements.

Constructors

SV :: Storable a => Vector a -> StorableVector 

encodeVectors :: [(Codec, StorableVector)] -> ByteStringSource

Creates a strict ByteString by interleaving multiple Vectors.

decodeVector :: forall a. Storable a => Codec -> ByteString -> Vector aSource

Creates a Vector by decoding a strict ByteString