So, I wanted to do something that I assumed would be really simple. Given two lists, $A = \{a\_1, a\_2, ...\}, B = \{ ... \}$, I wanted to take a function $f(a, b)$ and generate a list with $\{ f(a\_1, b\_1), f(a\_1, b\_2), ... \}$, i.e. just the cartesian product.

Of course, it's really easy, in principal, to do this:

```
f[#1, #2] & @@@ Outer[List, {a1, a2, a3}, {b1, b2}]

```

The annoyance comes in when the elements are themselves lists. In this case, everything breaks. Ridiculous things start happening.

There is a "trivial" solution; just use dummy variables in the above statement, and replace it in with what I want later. But to me this seems fundamentally wrong somehow. Surely it should be possible to work with lists of arbitrary type; and not have to "protect" your mapping functions from lists of lists.

Any thoughts? Am I missing some fundamental strategy here?

-- Edit:

To elaborate more, I'm actually trying to make the following work:

```
dim = 2; (* Say *)
Table[
  SomeFunc[dim, g, op, #] & /@ 
    Subsets[Range[dim], {i}], {i, 1, dim}
]

```

`op` previously was a single matrix; but now I need it to be a list of matricies. That is so say, I want to run "SomeFunc" for each matrix in that list, and also each of the results that come from the `Subset` function (note, of course, that `Subsets` returns lists.)