pipes-vector-0.5.1: 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) rSource

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

data ToVector v e m r Source


Monad m => Monad (ToVector v e m) 
Functor m => Functor (ToVector v e m) 
(Monad m, Functor m) => Applicative (ToVector v e m)