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

-- | Serialize instances for Data.Vector types.
--   
--   Serialize instances for Data.Vector types.
@package cereal-vector
@version 0.2.0.1

-- | Data.Serialize functions for Data.Vector.Generic
--   vectors. Orphan instances are provided for Data.Vector,
--   Data.Vector.Unboxed, Data.Vector.Storable, and
--   Data.Vector.Primitive vectors.
--   
--   The serialized format is an Int64 representing the length of
--   the vector, followed by the Data.Serialized contents of each
--   element.
--   
--   Note that the functions in Data.Vector.Storable.UnsafeSerialize
--   perform much better when serialization does not need to account for
--   host endianness and word size.
module Data.Vector.Serialize

-- | Read a Vector.
genericGetVector :: (Serialize a, Vector v a) => Get (v a)

-- | Write a Vector.
genericPutVector :: (Serialize a, Vector v a) => Putter (v a)

-- | Read a Vector using custom Get for the vector's
--   elements.
genericGetVectorWith :: Vector v a => Get a -> Get (v a)

-- | Write a Vector using custom Putter for the vector's
--   elements.
genericPutVectorWith :: Vector v a => Putter a -> Putter (v a)
instance (Data.Serialize.Serialize a, GHC.Internal.Foreign.Storable.Storable a) => Data.Serialize.Serialize (Data.Vector.Storable.Vector a)
instance (Data.Serialize.Serialize a, Data.Vector.Unboxed.Base.Unbox a) => Data.Serialize.Serialize (Data.Vector.Unboxed.Base.Vector a)
instance (Data.Serialize.Serialize a, Data.Primitive.Types.Prim a) => Data.Serialize.Serialize (Data.Vector.Primitive.Vector a)
instance Data.Serialize.Serialize a => Data.Serialize.Serialize (Data.Vector.Vector a)

-- | Efficient, but unsafe Get and Putter for
--   Data.Vector.Storable vectors. The serialized format is an
--   Int64 representing the length of the Vector, followed by
--   the raw bytes. Therefore behavior may be unpredictable if serialized
--   data is transferred between machines with different word size or
--   endianness.
module Data.Vector.Storable.UnsafeSerialize

-- | Get a Vector in host order, endian form, and word width.
unsafeGetVector :: Storable a => Get (Vector a)

-- | Put a Vector in host order, endian form, and word width.
unsafePutVector :: Storable a => Putter (Vector a)
