Safe Haskell | None |
---|
Data.Layout.Vector
- data Codec
- compile :: Layout -> Codec
- data StorableVector where
- SV :: Storable a => Vector a -> StorableVector
- encodeVectors :: [(Codec, StorableVector)] -> ByteString
- decodeVector :: forall a. Storable a => Codec -> ByteString -> Vector a
Documentation
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 Vector
s.
decodeVector :: forall a. Storable a => Codec -> ByteString -> Vector aSource
Creates a Vector
by decoding a strict ByteString