Hello @core-libs-dev <[email protected]>, When working with streams, I often run into situations where I have to "demote" back to imperative code because I am trying to solve a problem best solved by recursion.
Consider the common use case of cycling through permutations to find all permutations that satisfy some condition. With recursion, the answer is incredibly simple -- just grab an element from the set, then call the recursive method with a copy of the set minus the grabbed element. Once you reach the empty set, you've reached your terminal condition. Use cases like that are not only incredibly common, but usually, embarrassingly parallel. The example above of cycling through permutations is only a few lines of imperative code, but I struggle to imagine how I would do this with Streams. I guess let me start by asking -- are there any good ways currently to accomplish the above permutation example with Streams? And if not, should there be? Thank you for your time and consideration. David Alayachew
