Closed nhenin closed 4 years ago
You can convert a Producer
to a Pipe
of the same output type, like this:
import Pipes
import Pipes.Core
producerToPipe :: Monad m => Producer b m r -> Pipe a b m r
producerToPipe producer = closed >\\ producer
... and then once you do so you can sequence the Producer
after any Pipe
that shares the same output type:
producerAfterPipe :: Monad m => Pipe a b m r -> Producer b m r -> Pipe a b m r
producerAfterPipe pipe producer = do
pipe
producerToPipe producer
Thanks !!
@nhenin: You're welcome! 🙂
Hi, I need to concat a stream on each value produced by an processing upstream... Basically appending a
Producer
to aPipe
, I'm struggling a bit doing that with Pipes...Thanks !