I\'m trying to reproduce what accumulate does using for_each. However I don\'t understand what is the problem in the for_each version:
accumulate
for_each