"Flattens" a list containing sub-lists, such that all the "leaves" of the original list appear in the result list without any intervening list levels. Basically, all intermediate list braces are removed leaving a one-level list .
flatten ( list As List) As List
Argument | Type | Description |
---|---|---|
list | List | Original list . |
Intent >flatten({{a}, b, {{c}, d}}) --> {a, b, c, d}
Intent >flatten({{1, 3}, {2, {4}}, 7, {{}, {{5}, 6}}}) --> {1, 3, 2, 4, 7, 5, 6}
Intent >flatten({}) --> {}