Safe Haskell | None |
---|

Process chunks of data in the IO monad. Typical inputs are strict storable vectors and piecewise constant values, and typical outputs are strict storable vectors. You may also combine several of these types using the Zip type constructor.

We may substitute IO by ST in the future, but I am uncertain about that. On the one hand, the admissible IO functionality is very restricted, only memory manipulation is allowed, on the other hand we use ForeignPtrs that are not part of ST framework.

- data T a b = forall state . Cons (a -> state -> IO (b, state)) (IO state) (state -> IO ())
- fromCausal :: Monoid b => T a b -> T a b
- mapAccum :: (a -> state -> (b, state)) -> state -> T a b
- traverse :: state -> (a -> State state b) -> T a b
- runCont :: (Transform a, Transform b) => T a b -> IO (([a] -> [b]) -> [a] -> [b])
- runStorableChunkyCont :: (Storable a, Storable b) => T (Vector a) (Vector b) -> IO ((Vector a -> Vector b) -> Vector a -> Vector b)
- zip :: Arrow arrow => arrow a b -> arrow a c -> arrow a (T b c)
- continue :: (Transform a, Transform sig b) => T a (sig b) -> (b -> T a (sig b)) -> T a (sig b)
- continueChunk :: (Transform a, Transform b) => T a b -> (b -> T a b) -> T a b

# Documentation

fromCausal :: Monoid b => T a b -> T a bSource

runCont :: (Transform a, Transform b) => T a b -> IO (([a] -> [b]) -> [a] -> [b])Source

This function converts a process into a function on lazy storable vectors. To this end it must call unsafePerformIO, that is, the effects of all functions called in the process must not be observable.

I am not sure, we need this function at all.

runStorableChunkyCont :: (Storable a, Storable b) => T (Vector a) (Vector b) -> IO ((Vector a -> Vector b) -> Vector a -> Vector b)Source

The same restrictions as for `runCont`

apply.