Of course in Elixir[1] reduce is more efficient (at least memory-wise) than map/flat_map, but in case of scripting it usually doesn't matter (unless this JSON file is huge, but it's fully loaded into memory and parsed there anyway).
I would rewrite the example from the post like this (NOTE: I didn't run it, so it might be slightly incorrect):
I would rewrite the example from the post like this (NOTE: I didn't run it, so it might be slightly incorrect):
---1. although map is much easier to parallelize/vectorize (e.g. in Array PLs)