flatten function
Nested lists flattened into one list.
How to write it
flatten(list)
- list
- A list of lists. Takes a list.
Examples
flatten([[1, 2], [3]])In the solver,
Open in the solverflatten([[1, 2], [3]])gives[1, 2, 3].
Related functions
- fold
Combine the elements of a list from the left with a function, starting from a value.
- first
The first element of a list.
- fold_list
The steps of fold: every partial result, starting from the first value.
- drop
A list without its first elements.
- head
The head of an expression: the name of the function it is a call of.
- dimensions
The size of a list or a matrix, level by level.