
Michael Snoyman
You can use Data.Conduit.Lazy for this.
Thanks. Not as straightforward as I had hoped, but I can see why. On a different note, still attempting to learn, I am trying to use Network.Wai.Conduit with a conduit that has effects (ie involves sourceFile), and so lives in (ResourceT IO). eg example:: ConduitT i (Flush Builder) (ResourceT IO) () Now, responseSource expects IO, not ResourceT IO, so I don’t think I can use that, so I wrote this:
responseSourceRes status headers res_conduit = responseStream status200 headers (\send flush -> runConduitRes $ res_conduit .| mapM_ (\e->lift $ case e of Chunk c -> send c Flush -> flush ))
which runs, but (rather to my surprise) doesn’t produce output (not even headers) until all the effects have completed. That gives rise to two questions: Why does that not stream output? What should I do instead? -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk