pkg/list: adding flatten function as a builtin
this commit adds a new builtin to the list package for generating a
flat list from a nested lists by expanding nested lists in place.
for instance
list.Flatten([1, [[2, 3], []], [4]])
results in
[1, 2, 3, 4]
Change-Id: Ia462f7f2db504fd49601a3c77c0fae9387c038c4
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3460
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
authored by