Anyone care to explain why this doesn't return a gigantic list of empty arrays and one solution tuple? I don't see where the non-solution []'s are removed from the list.
In the Python code I think this is built into the behavior of the `+=` operator.
In the Perl code it's part of the way the `map` call works; it combines what would be `concat . map` in Haskell.