| Safe Haskell | None |
|---|
Pipes.Vector
Contents
Description
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.
Usage
>>>run $ runToVectorP $ each [1..5::Int] >-> toVectorfromList [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