Is your editor open source? It looks really interesting.
parallel_map(Fun, List) ->
Last = lists:foldl(fun(Value, Parent) ->
spawn(fun() ->
MappedValue = Fun(Value),
receive
Rest -> Parent ! [MappedValue|Rest]
end
end)
end, self(), List),
Last ! [],
receive
Result -> Result
end.
It essentially sets up a chain of processes which pass their results to their parent when they finish their mapping operation.