[Haskell-cafe] Conduits vs. lazy byte strings

Mike Meyer mwm at mired.org
Sun May 18 11:30:41 UTC 2014

I'm working on a web app that loads a file, tweaks it a bit, then downloads
the results. I'd like for it to use the minimal amount of memory possible,
just as good practice. Especially since the tweaking all happens in the
first K or so of the file, and the rest of it is passed through untouched.

The current version uses a conduit that just reads the data to a sinkLbs to
get a lazy bytestring, which is then processed.

I think this will have the desired behavior (after all, the bytestring is
lazy), but have this itch that says I should be doing the processing in the

Someone want to tell me if I correctly understand things and the itch is
just leftover imperative thinking, or the itch is right and I need to fix
the code?

If you're intersted, you can find the code at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140518/4010ba85/attachment.html>

More information about the Haskell-Cafe mailing list