Am I mistaken or do these functions not exist? How would I go about doing things like that? Do I actually need to implement them myself?
I think you are looking for joinMap
And join
instead of flatten
Ah cool, thanks. What about something like joinMapWithIndex?
As far as I know, it doesn't exists. I use mapWithIndex followed by join in that case. Slightly less performant, but it works
If you really want the full performance, you'd need to use walk(WithIndex)
and allocate the buffer manually up front with List.withCapacity
If you have fold(walk) you can build anything as my old CTO once told me
Last updated: Jul 06 2025 at 12:14 UTC