This Commented CUE
demonstrates how to use the built-in function
list.Concat
to concatenate a list of lists.
file.cue
package example
import "list"
output: list.Concat([listA, listB, listC, listB])
listA: [1, 2, 3, 4]
listB: ["hello", "world"]
listC: [{
a: 10
b: "10"
}, {
a: 11
b: "11"
}, {
a: 12
b: "12"
}]
TERMINAL
$ cue export -e output
[
1,
2,
3,
4,
"hello",
"world",
{
"a": 10,
"b": "10"
},
{
"a": 11,
"b": "11"
},
{
"a": 12,
"b": "12"
},
"hello",
"world"
]
Related content
- The
list
built-in package