sdr-0.1.0.9: A software defined radio library

SDR.VectorUtils

Description

Various Vector based utility functions

Synopsis

# Documentation

Arguments

 :: Monad m => (acc -> x -> m (acc, y)) The function -> acc The initial accumulator -> Stream m x The input stream -> Stream m y The output stream

Like mapAccumL but monadic and over vectors. Doesn't return the accumulator at the end because it doesn't seem to be possible to do this with the Stream datatype, making this function pretty useless.

Arguments

 :: Vector v a => Int The stride -> v a The input Vector -> v a The output Vector

Create a vector from another vector containing only the elements that occur every stride elements in the source vector.

Arguments

 :: (PrimMonad m, Functor m, MVector vm a) => Bundle v a The input Stream -> vm (PrimState m) a The mutable Vector to stream into -> m ()

Fill a mutable vector from a monadic stream. This appears to be missing from the Vector library.

Arguments

 :: (PrimMonad m, MVector vm a, Vector v a) => vm (PrimState m) a The destination -> v a The source -> m ()

Copy a Vector into a mutable vector

Arguments

 :: Vector v x => Int Generates a vector with this size -> (acc -> (x, acc)) The generator function -> acc The initial value of the seed -> (v x, acc) The (vector, final value of seed) result

Similar to unfoldrN from the vector package but the generator function cannot terminate and it returns the final value of the seed in addition to the vector

Arguments

 :: (PrimMonad m, Vector v x) => Int Generates a vector with this size -> (acc -> m (x, acc)) The monadic generator function -> acc The initial value of the seed -> m (v x, acc) The (vector, final value of seed) result

The same as vUnfoldr but the generator function is monadic