vector-conduit-0.2.1.0: Conduit utilities for vectors

Safe HaskellSafe-Infered

Data.Vector.Conduit

Synopsis

Documentation

sourceVector :: (Resource m, Vector v a) => v a -> Source m aSource

Use an immutable vector as a source.

sourceMVector :: (PrimMonad m, Resource m, MVector v a) => v (PrimState m) a -> Source m aSource

Use a mutable vector as a source in the ST or IO monad.

consumeVector :: (PrimMonad m, Resource m, Vector v a) => Sink a m (v a)Source

Consumes all values from the stream and return as an immutable vector.

consumeVectorN :: (PrimMonad m, Resource m, Vector v a) => Int -> Sink a m (v a)Source

Consumes the first n values from a source and returns as an immutable vector.

consumeMVector :: (PrimMonad m, Resource m, MVector v a) => Sink a m (v (PrimState m) a)Source

Consumes all values from the stream and returns as a mutable vector.

consumeMVectorN :: (PrimMonad m, Resource m, MVector v a) => Int -> Sink a m (v (PrimState m) a)Source

Consumes the first n values from the stream and returns as a mutable vector.

thawConduit :: (PrimMonad m, Resource m, Vector v a) => Conduit (v a) m (Mutable v (PrimState m) a)Source

Conduit which thaws immutable vectors into mutable vectors

freezeConduit :: (PrimMonad m, Resource m, Vector v a) => Conduit (Mutable v (PrimState m) a) m (v a)Source

Conduit which freezes mutable vectors into immutable vectors