# List of functions to list of parameters

I am working in a Dataset and I need to create a function for a ChartStyle option of a BarChart that takes a list of the items to be plotted. I would like to lighten the plot style colour by the value of the item to be plotted. I have created a function that gets me the list of functions for each PlotStyle.

Function[{value}, Nest[Lighter, #, 3 - value]] & /@ {Yellow, Orange, Blue}


value will be an integer between 0 and 3 inclusive. Is there some use of Through or Outer or Inner or something that will map a list of length to each position in this list of functions such that:

{f1, f2, f3}[{x1, x2, x3}] -> {f1[x1], f2[x2], f3[x3]}


This is in a Dataset query so I'm hoping for something concise that is easy to read and that is a one liner with the function list definition given above.

• I'm pretty sure this is a dupe... Nov 7, 2015 at 7:34

Inner[#1[#2] &, {f1, f2, f3}, {x1, x2, x3}, List]

(*  {f1[x1], f2[x2], f3[x3]}  *)

#[][#[]] & /@
Transpose[{{f1, f2, f3}, {x1, x2, x3}}]

(*  {f1[x1], f2[x2], f3[x3]}  *)

• ...and my standard solution, MapThread[#1@#2 &, {{f1, f2, f3}, {x1, x2, x3}}], which is a variant of the Inner solution. Nov 7, 2015 at 5:18
• ... and similar to MapThread[Apply, {{f1, f2, f3}, Transpose[{{x1, x2, x3}}]}]. Nov 7, 2015 at 6:12
Needs["GeneralUtilities"]
MultiMapAt[Range, {f1, f2, f3}][{x1, x2, x3}]


$\${f1[x1], f2[x2], f3[x3]}

Which is equivalent to using

(Composition @@ MapThread[MapAt, {{f1, f2, f3}, Range}])[{x1, x2, x3}]


Or

MapIndexed[{f1, f2, f3}[[First@#2]]@#1 &, {x1, x2, x3}]


$\${f1[x1], f2[x2], f3[x3]}

Or

#1[#2] & @@@ Thread[{{f1, f2, f3}, {x1, x2, x3}}]


$\${f1[x1], f2[x2], f3[x3]}

Which is similar to

#1[#2] & @@@ Thread[{f1, f2, f3} -> {x1, x2, x3}]


and

Thread[{f1, f2, f3} -> {x1, x2, x3}] /. Rule -> (#1[#2] &)


Or

{f1, f2, f3}~Function[, #1[#2], Listable]~{x1, x2, x3}


$\${f1[x1], f2[x2], f3[x3]}

• Thank you for introducing MultiMapAt +1 :) Nov 7, 2015 at 6:25
• Lots on interesting solutions here. Thanks. Nov 7, 2015 at 14:16
f = {f1, f2, f3};
x = {x1, x2, x3};

Block[{i = 0}, List @@ (f /. s_Symbol :> s[x[[i++]]])]
`

{f1[x1], f2[x2], f3[x3]}