Trees of data in Elixir

Yes, it is a tree.

What Saša Jurić describes is someting that came to my mind lately. Elixir is functional by design, and using agents I could easily reinvent OOP by encapsulating state, only with objects come to life as a process.

What I think about now is, if I use a single big nested map, is there a way to use parallelism? Using the whole map, I have to use Enum.reduce to transform the children of a node. If I use agents instead, I can transform the children by using Enum.map in parallel, for each one has its own data seperated. I just have to keep in mind to return a new agent for each and don’t reuse the existing one.