pipes-vector-0.6.2: 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) 
Monad m => Monad (ToVector v e m) 
Functor m => Functor (ToVector v e m) 
(Monad m, Functor m) => Applicative (ToVector v e m) 
PrimMonad m => PrimMonad (ToVector v e m) 
MonadPrim m => MonadPrim (ToVector v e m) 
MonadIO m => MonadIO (ToVector v e m) 
type BasePrimMonad (ToVector v e m) = BasePrimMonad m 
type PrimState (ToVector v e m) = PrimState m