Map a possibly nested sequence to its flattend version, which comprises only the ground element. For example, the sequence

[1, [2, 3], 4, [5, [6, 7]]]

should be mapped to

[1, 2, 3, 4, 5, 6, 7]

Updated: