Flatten Array in Perl 6
Take a nested list and return a single list with all values except nil/null
exercism fetch perl6 flatten-array
Take a nested list and return a single flattened list with all values except nil/null.
The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
Running the tests
There is a test suite and module included with the exercise.
The test suite (a file with the extension
.t) will attempt to run routines
from the module (a file with the extension
Add/modify routines in the module so that the tests will pass! You can view the
test data by executing the command
perl6 --doc *.t (* being the name of the
test suite), and run the test suite for the exercise by executing the command
prove . --exec=perl6 in the exercise directory.
You can also add the
-v flag e.g.
prove . --exec=perl6 -v to display all
tests, including any optional tests marked as 'TODO'.
Interview Question https://reference.wolfram.com/language/ref/Flatten.html
Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.