Say I have two lists,
list1 = {a, b, c}
list2 = {x, y, z}
and I want to map a function f over them to produce
{f[a,x], f[a,y], f[a,z], f[b,x], f[b,y], f[b,z], f[c,x], f[c,y], f[c,d]}
I would assume I map the function over the first list to produce a "list of functions", which then run over the 2nd list, something like:
Map[Map[f[#1, #2]&,list1]&, list2]
but I can't figure out how to leave #2 "empty" until the 2nd map kicks in. How can I separate them to generate all combinations of arguments?
Function
—Map[Function[x, Map[f[#1, x] &, list1]], list2]
— although I'd useOuter
myself. $\endgroup$