<Head-tail splitting for sequences: avoid re-enter...
# forum
r
Head-tail splitting for sequences: avoid re-entering sequence generator without casting Sequence to Iterator? Hi let’s imagine a Sequence instance is given and we want to split it into a pair consisting of sequence’s head element and the tail rest of the sequence. Q: Is it possible to implement such thing without casting Sequence to Iterator? Q: If it is not currently possible purely in Sequences, what Sequence’s feature is missing? The code to start with: /** * could we avoid re-entering sequence generator without casting...