I have been trying to figure it out and I am probably very close, but I have spent 2 hours without sucess. I have the expression below
MapIndexed[
geg[First[#2],
Total[KeyValueMap[fef[#1, #2, mem] &, #1]]] &, {<|a -> b,
c -> d|>, <|e -> f|>}]
which produces
{geg[1, fef[a, b, mem] + fef[c, d, mem]], geg[2, fef[e, f, mem]]}
I want to have the position of the association in the list {<|a -> b,
c -> d|>, <|e -> f|>}
passed both to geg
and fef
That is, I want the result to be
{geg[1, fef[a, b, 1, mem] + fef[c, d, 1, mem]], geg[2, fef[e, f, 2, mem]]}
MapIndexed[f[#[[1]], #[[2]], #2]&, Normal[assoc]]
? $\endgroup$ – b3m2a1 Feb 4 '20 at 22:46Table[KeyValueMap[f[##, i]&, assocs[[i]]], {i, Length@assocs}]
$\endgroup$ – b3m2a1 Feb 4 '20 at 23:07