Does Kotlin have a nice way to "chain" two sequenc...
# announcements
n
Does Kotlin have a nice way to "chain" two sequences? That is, return a sequence that first goes through the elements of the first sequence, then of the second. The closest thing I see is flatten, which I could make work, but it's intended for sequences of sequences, not simply 2 (or 3, etc) sequences that I already have as separate variables
s
just to clarify, are you looking to concatenate the sequences or run through them in parallel?
if it’s the former, I think this SO answer covers why
flatten
actually works for you https://stackoverflow.com/questions/40161956/kotlin-sequence-concatenation
n
concatenate
yeah i came up with sequenceOf and flatten as well 🙂 but I can see that operator + works!
neat
thanks!
👍 1