Jelly, 33 2 bytes
-1 byte thanks to Dennis (W
wraps)
;ẆßWß
A link (i.e. function or method), which also works as a full program, that recursively concatenates all non-empty contiguous sublists of its input towraps its input into a list.
The input starts as zero so the first pass creates the list [0]
The second pass then makes this [0,[0]][[0]]
The third pass then makes this [[[0]]]
and so on...
Previous 3 byter, which leaks much faster:
;Ẇß
recursively concatenates all non-empty contiguous sublists of its input to its input.
[0]
-> [0,[0]]
-> [0,[0],[0],[[0]],[0,[0]]]
and and so on...