As this question asked for python, what is the equivalent of Haskell's scanl in Java's streams?
The best I've come up with so far is to use
reduce(identity, accumulator, combiner)
with an accumulator that keeps the latest result and accumulates the results in a list, though the combiner would presumably not be not used. I'm also not sure how to prevent it from being used in parallel, where it would not work.
Perhaps Stream is the wrong interface for (an equivalent of) scanl?