Multiple FFI calls to a Haskell function with side-effects
I want to write a Haskell function that receives a vector and returns another one with the same size but delayed by a certain number of samples d
(add zeroes at the start). Because the produced vector must have the same size, it must buffer the remaining samples so the next application of this function from C continues on with the previously buffered samples. To do so I implemented a ring-buffer concept and hooked it up to C through FFI.