Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume that this built-in function is called func. What I want is


will return the following result:


I can achieve this by defining a function myself:

myfunc[functions_List, data_] := 
    Table[Map[fn, data], {fn, functions}];

But is there some built-in function to achieve the same result?

(I have to admit that, after months intermittent reading of The Mathematica Book my knowledge is still very limited compared with what exist unknown in the sea.)

share|improve this question
Related: (9784), (11298) – Mr.Wizard Aug 23 '14 at 4:02
up vote 6 down vote accepted


Well I guess I should retire for the evening to a less brain-intensive activity as apparently I can't think clearly. One could of course use Outer:

Outer[Compose, {f, g}, {a, b, c}]
{{f[a], f[b], f[c]}, {g[a], g[b], g[c]}}

However I recommend that you do not do this as you will not gain the auto-compilation of Map, meaning this method will often be slower. Please see Leonid's explanation of this issue.

Old, half-awake answer

As far as I can remember there is no function that does specifically this in one step. I have used a more terse version of your own solution myself:

myMap[fns_, data_] := # /@ data & /@ fns

myMap[{f, g}, {a, b, c}]
{{f[a], f[b], f[c]}, {g[a], g[b], g[c]}}

There are of course many alternatives, e.g.:

Thread /@ Through[{f, g}[{a, b, c}]]
{{f[a], f[b], f[c]}, {g[a], g[b], g[c]}}

However this inferior because it first evaluates to:

{f[{a, b, c}], g[{a, b, c}]}

Which means that f and g may evaluate before the operation is complete. One could add an Unevaluated, Hold, Inactive etc., but that seems like pointless complexity.

Just for fun we could make use of the operator form of Map in version 10:

Through[(Map /@ {f, g})[{a, b, c}]]
{{f[a], f[b], f[c]}, {g[a], g[b], g[c]}}
share|improve this answer
Thanks, they are very helpful informations! – Naitree Aug 23 '14 at 7:43

I don't think there's any built-in function to do this, but here is an alternative:

myFunc[func_, data_] := Transpose[Through[func[#]] & /@ data]


myFunc[{f, g, h}, {a, b, c}]

{{f[a], f[b], f[c]}, {g[a], g[b], g[c]}, {h[a], h[b], h[c]}}

share|improve this answer
Thanks for alternative! – Naitree Aug 23 '14 at 7:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.