pipes-vector-0.6: Various proxies for streaming data into vectors

Safe HaskellNone




Pipes for interfacing with Data.Vector.

Note that this only provides functionality for building Vectors from Pipes; as Vectors are Foldable the inverse can be accomplished with "Pipes.each".



>>> run $ runToVectorP $ each [1..5::Int] >-> toVector
fromList [1,2,3,4,5]

toVector :: (PrimMonad m, MVector (Mutable v) e) => Consumer e (ToVector v e m) r Source

Consume items from a Pipe and place them into a vector

For efficient filling, the vector is grown geometrically up to a maximum chunk size.

runToVectorP :: (PrimMonad m, Vector v e) => Proxy a' a b' b (ToVector v e m) r -> Proxy a' a b' b m (v e) Source

Extract and freeze the constructed vector

runToVector :: (PrimMonad m, Vector v e) => ToVector v e m r -> m (v e) Source

fromProducer :: (Vector v e, PrimMonad m) => Producer e (ToVector v e m) r -> m (v e) Source

data ToVector v e m r Source


MonadTrans (ToVector v e) Source 
Monad m => Monad (ToVector v e m) Source 
Functor m => Functor (ToVector v e m) Source 
Monad m => Applicative (ToVector v e m) Source 
PrimMonad m => PrimMonad (ToVector v e m) Source 
MonadIO m => MonadIO (ToVector v e m) Source 
MonadPrim m => MonadPrim (ToVector v e m) Source 
type PrimState (ToVector v e m) = PrimState m Source 
type BasePrimMonad (ToVector v e m) = BasePrimMonad m Source