snoyberg/conduit — comment on commit a7583d3e5d1958c10c3630180f208773c068c44d
File: Data/Conduit.hs line 143
By snoyberg:

I'm fairly certain what we have here is right. Imagine two conduits: one groups chunks into five-tuples. If it receives data which is not a multiple of 5, it returns the extras as leftover. The second conduit does the same thing, but stores extras internally, only giving them as leftover on close. Both are valid approaches.

Now imagine push through the numbers 1 to 6, and then close, e.g.: conduitPush [1..6] >> conduitClose []. With the code as it stands now, both conduits will properly return [6] when conduitClose is called. With any alternative (I believe), data could be lost.