H. S. Teoh:

What you describe could be an interesting candidate to add, though. It could iterate over distinct values of the predicate, and traverse the forward range (input ranges obviously can't work unless you allocate, which makes it no longer lazy) each time. This, however, has O(n*k)
complexity where k is the number of distinct predicate values.

Let's allocate, creating an associative array inside the grouping function :-)

Bye,
bearophile

Reply via email to