Recently I was working on a problem where I needed to get a vector of vectors containing an entry
for every possible path when given a vector which might contains scalar values or vectors of scaler
values.
Some examples:
input
output
[:a]
[[:a]]
[1]
[[1]]
[:a :b :c]
[[:a :b :c]]
[:a [:b]]
[[:a :b]]
[:a [:b :c]]
[[:a :b] [:a :c]]
[[:a :b] [:c :d]]
[[:a :c] [:a :d] [:b :c] [:b :d]]
Here is my solution to the problem:
Tests:
As it turns out, I can’t use it. I might as well post it.