Hacker News new | ask | show | jobs
by _randyr 1098 days ago
You can skip the last Enum.map/into and just use Map.new:

    "file.json"
    |> File.read!()
    |> Jason.decode!()
    |> Stream.flat_map(& &1["children"])
    |> Map.new(fn child -> {child["id"], child} end)