Let's say I have some function which takes a scalar argument and uses it to produce an array like so:
fn compute(x: u32) -> Array1<u32> {
// ...
}
If I map this function onto an Array of u32, I get an Array of Arrays:
let a = arr1(&[1, 2, 3, 4]); // a has type Array1<u32>
let b = a.map(|x| compute(x)); // b has type Array1<Array1<u32>>
Is there a way to map that creates a higher-dimension array? For example:
let c = a.hypothetical_map(|x| compute(x)); // c has type Array2<u32>