ComapApply
✖
ComapApply
Details and Options

- ComapApply is typically used to apply each of a list of functions to the same sequence of arguments. »
- With the option setting HeadsTrue, ComapApply includes heads of expressions and their parts. »
- ComapApply always effectively constructs a complete new expression and then evaluates it. »
- The head of fs in ComapApply[fs,expr] need not be List.
- If fs is an Association object, ComapApply[fs,expr] replaces the head of expr with the values in the association. »
- ComapApply[fs][expr] is equivalent to ComapApply[fs,expr].
- Parallelize[ComapApply[fs,expr]] computes ComapApply[fs,expr] in parallel on all subkernels. »
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Replace the head of {1,2} with each element of a list:

https://wolfram.com/xid/0dqug9da8n4-bcjear

Use the operator form of ComapApply:

https://wolfram.com/xid/0dqug9da8n4-nbstpo

Replace the head of an expression with the values in an association:

https://wolfram.com/xid/0dqug9da8n4-odj9lh

Scope (3)Survey of the scope of standard use cases

https://wolfram.com/xid/0dqug9da8n4-b177zc


https://wolfram.com/xid/0dqug9da8n4-jt6vyg

ComapApply can be used on expressions with any head:

https://wolfram.com/xid/0dqug9da8n4-g2btx8

Replace the head of an expression with the values of an Association:

https://wolfram.com/xid/0dqug9da8n4-zq92pg

Options (1)Common values & functionality for each option
Properties & Relations (8)Properties of the function, and connections to other functions
ComapApply successively replaces the head of an expression with the parts of another expression:

https://wolfram.com/xid/0dqug9da8n4-qiju27

MapApply replaces the head of each part of an expression with another expression:

https://wolfram.com/xid/0dqug9da8n4-sin1b

Through[p[f,g,…][x,y,…]] is equivalent to ComapApply[p[f,g,…],{x,y,…}]:

https://wolfram.com/xid/0dqug9da8n4-lsocle


https://wolfram.com/xid/0dqug9da8n4-pzt1zm

Compare this to the operator form of ComapApply:

https://wolfram.com/xid/0dqug9da8n4-0rxctr

ComapApply[p[f,g,…],{x,y,…}] can be used even when p[f,g,…][x,y,…] has a value:

https://wolfram.com/xid/0dqug9da8n4-dsppnj

When p[f,g,…][x,y,…] has a value, Through cannot be used:

https://wolfram.com/xid/0dqug9da8n4-zz3f9i


https://wolfram.com/xid/0dqug9da8n4-rkkly9

ComapApply[{f1,f2,…},expr] is equivalent to Map[f ->Apply[f,expr],{f1,f2,…}] when the fi have no attributes:

https://wolfram.com/xid/0dqug9da8n4-locw8i


https://wolfram.com/xid/0dqug9da8n4-zkb3ce

ComapApply can replace the head of an expression with parts inside held expressions without allowing evaluation to proceed:

https://wolfram.com/xid/0dqug9da8n4-nvkef8

Use ReleaseHold to allow evaluation to proceed:

https://wolfram.com/xid/0dqug9da8n4-pywof2

If only some arguments are held, only those arguments will not evaluate further:

https://wolfram.com/xid/0dqug9da8n4-yo0lq2

https://wolfram.com/xid/0dqug9da8n4-u1l366

Use Unevaluated to replace the head of an expression with different expressions without evaluating it first:

https://wolfram.com/xid/0dqug9da8n4-lp8w4v

The expression is evaluated first by default:

https://wolfram.com/xid/0dqug9da8n4-emed18

Use Unevaluated to replace the head of an expression with the parts of an expression without evaluating it first:

https://wolfram.com/xid/0dqug9da8n4-n5e5cs

The expression is evaluated first by default:

https://wolfram.com/xid/0dqug9da8n4-2cdpsw

ComapApply can be parallelized automatically:

https://wolfram.com/xid/0dqug9da8n4-jjasnc

Wolfram Research (2024), ComapApply, Wolfram Language function, https://reference.wolfram.com/language/ref/ComapApply.html.
Text
Wolfram Research (2024), ComapApply, Wolfram Language function, https://reference.wolfram.com/language/ref/ComapApply.html.
Wolfram Research (2024), ComapApply, Wolfram Language function, https://reference.wolfram.com/language/ref/ComapApply.html.
CMS
Wolfram Language. 2024. "ComapApply." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ComapApply.html.
Wolfram Language. 2024. "ComapApply." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ComapApply.html.
APA
Wolfram Language. (2024). ComapApply. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComapApply.html
Wolfram Language. (2024). ComapApply. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComapApply.html
BibTeX
@misc{reference.wolfram_2025_comapapply, author="Wolfram Research", title="{ComapApply}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/ComapApply.html}", note=[Accessed: 09-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_comapapply, organization={Wolfram Research}, title={ComapApply}, year={2024}, url={https://reference.wolfram.com/language/ref/ComapApply.html}, note=[Accessed: 09-July-2025
]}