Hello list, I have a Producer of the following type:
blockProducer :: Handle -> Producer Block IO () which reads Blocks from a file with the given handle, and yields a block one-by-one until EOF is reached. I also have a function of the following type: processBlock :: BlockState -> Block -> Either String BlockState which takes an initial BlockState, and updates it with Block, and returns either Right BlockState if no error occurs, or Left String if an error occurs. So I want to create a Pipe that consumes Blocks from blockProducer, folds them as if I were using (foldlM processBlock), and yields the resulting Either String BlockState. How do I do that? -- You received this message because you are subscribed to the Google Groups "Haskell Pipes" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipes+unsubscr...@googlegroups.com. To post to this group, send email to haskell-pipes@googlegroups.com.