3 ms·
I've done some tinkering with streams, and I was initially very excited. They do come with some frustrating limitations. Foremost in my mind: Concatenation of s
by RodgerTheGreat 9y ago
I've done some tinkering with streams, and I was initially very excited. They do come with some frustrating limitations. Foremost in my mind: Concatenation of streams is fairly straightforward, but how do I perform a parallel join (zip?) of multiple streams?
In other words, given [1,2,3] and ["A","B","C"], how do I map over [[1,"A"],[2,"B"],[3,"C"]]?
- dahauns 9y agoAFAIK this isn't possible yet in a straightforward way, and it boils down to limitations of the type system (lack of tuples resp. value types in general), and the (understandable) refusal of many to do it in way that's hacky and potentially slow. The discussion about this is actually quite old, for example: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-observers/2013-June/002046.html http://mail.openjdk.java.net/pipermail/lambda-libs-spec-obse... IIRC that's a problem on bytecode level, that's why a (clean) solution still hasn't come up yet.