I have a
foreign export stdcall tick :: Integer -> Float -> Float -> IO Int
On each invocation of this function, I wish to pass its arguments into a set of pipes from the haskell pipes library.
Between the invocations I don't want the pipes to forget the minimum and maximum of the arguments of the last 10 invocations.
How should I do this?
This is one of many things that
pipes-concurrency
is designed to do. What you do isspawn
a buffer and every time you call the derivedtick
function it will stuff its arguments inside that buffer. Then you can have a pipe stream everything that comes out of that buffer.