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 conduit.
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