-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Convert between ByteString and Vector.Storable without copying
--   
--   This library allows conversion between the types from
--   <tt>Data.ByteString</tt> (package <tt>bytestring</tt>) and
--   <tt>Data.Vector.Storable</tt> (package <tt>vector</tt>) without
--   copying the underlying data. This is useful, for example, when
--   <tt>ByteString</tt> IO produces or consumes vectors of numbers in
--   native byte order.
--   
--   This trick relies on the fact that <tt>ByteString</tt> and
--   <tt>Vector</tt> use their respective <tt>ForeignPtr</tt>s in
--   compatible ways. It works with <tt>bytestring-0.9.1.10</tt> and
--   <tt>vector-0.9</tt> on GHC 7.0. It may break with future releases of
--   these packages. Depending on this library should be seen as a way to
--   document and standardize an existing hack, and not as an absolute
--   guarantee of correct behavior.
@package spool
@version 0.1


-- | Convert between <tt>ByteString</tt> and <tt>Vector.Storable</tt>
--   without copying.
module Data.Vector.Storable.ByteString

-- | Convert a <tt><a>ByteString</a></tt> to a <tt><a>Vector</a></tt>.
--   
--   This function can produce <tt><a>Vector</a></tt>s which do not obey
--   architectural alignment requirements. On <tt>x86</tt> this should not
--   be an issue.
byteStringToVector :: Storable a => ByteString -> Vector a

-- | Convert a <tt><a>Vector</a></tt> to a <tt><a>ByteString</a></tt>.
vectorToByteString :: Storable a => Vector a -> ByteString
