Sent: Sunday, 7 April 2024 18:31
To: Viktor Klang ; core-libs-dev@openjdk.org
Subject: [External] : Re: JEP 473: Stream Gatherers (Second Preview)
On 24/04/07 9:11 AM, Viktor Klang wrote:
Hi Ernie,
"Many" in this case refers to "N", which is "0 ... N",
OK, I was w
Filter isn't many-to-... At all, at no point it collapses a
subsequence of elements, it only works on one element at a time
I was conflating the behavior of a specific intermediate operation with
a black box view of an operation. Looking at an operation as a black box
is useless (maybe mildly
Think about `flatMap` (which filter is a special case of), this is
one-to-many function that can also return 1 or 0 elements for each input.
So it makes sense to include 0 as "many".
Filter isn't many-to-... At all, at no point it collapses a subsequence of
elements, it only works on one element
On 24/04/07 9:11 AM, Viktor Klang wrote:
Hi Ernie,
"Many" in this case refers to "N", which is "0 ... N",
OK, I was wondering about "many" including "0".
so I'd say while it is techincally correct as-is, perhaps more precise
would be to say "1-to-0..1" gatherer, since for every element in,
Hi Ernie,
"Many" in this case refers to "N", which is "0 ... N", so I'd say while it is
techincally correct as-is, perhaps more precise would be to say "1-to-0..1"
gatherer, since for every element in, there is 0 or 1 element out.
Many-to-one would be 0..N -> 1, which means that an empty input