boothead/conduit — comment on commit de4b9583d150429c2a9234b0360d1e8bfce319bf
File:  line 0
By snoyberg:

When you get newP, you should apply it immediately to leftover. Then you'll need to pattern match on the result, and if you get a partial with leftover again, repeat the process *again*. Remember, a single chunk may contain dozens of matches (imagine the parser `anyChar`). Likewise for closing actually.

So you probably want to write a single function that handles the pattern matching, that takes three arguments: the current parser, some input to pass in, and a difference list of previous output generated during this push/close (i.e., `[a] -> [a]`).

HTH