Aggregate nested arrays

There is an example of building a list inside a list here.