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

Safe HaskellNone




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.


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