You will be given as input an infinite stream of positive integers.
Your task is to write a program which outputs an infinite sequence of lists with two requirements:
- All lists in the output are finite sub-lists of the input stream.
- Every sub-list must be output eventually by your program.
Sub-lists are not necessarily contiguous, so
[1,1] is a sub-list of
[0,1,0,1,0,..., and should be included in your output if your input was
The empty list
 is a sub-list of every possible input, so it should always be output at some point.
Aside from this, you can do what you want. You can output them in whatever order suits you, you can output any sub-list any (positive) number of times. It's up to you to figure out what's best.
This is code-golf so answers will be scored in bytes with fewer bytes being the goal.
Outputting an infinite sequence is done as per the defaults of the sequence tag wiki.
Input of an infinite sequence is basically the dual of those rules. You may:
- Take the input as a black-box function which takes \$n\$ and outputs the \$n\$th term
- Take the input as a black-box function which takes \$n\$ and outputs all terms up to the \$n\$th term
- Take the input as a lazy list, generator or stream.
- Take the input by repeatedly querying STDIN each time receiving the next term of the sequence.