spool-0.1: Convert between ByteString and Vector.Storable without copying

Safe Haskell | None
Language | Haskell98

Data.Vector.Storable.ByteString

Description

Convert between `ByteString` and `Vector.Storable` without copying.

Synopsis

- byteStringToVector :: Storable a => ByteString -> Vector a
- vectorToByteString :: Storable a => Vector a -> ByteString

# Documentation

See also the caveats mentioned in the package's top-level documentation.

byteStringToVector :: Storable a => ByteString -> Vector a Source #

Convert a ``ByteString`` to a ``Vector``.

This function can produce ``Vector``s which do not obey architectural alignment requirements. On `x86` this should not be an issue.

vectorToByteString :: Storable a => Vector a -> ByteString Source #

Convert a ``Vector`` to a ``ByteString``.