WOLFRAM

ComapApply[{f1,f2,},expr]

gives {Apply[f1,expr],Apply[f2,expr],}.

represents an operator form of ComapApply that can be applied to an expression.

Details and Options

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Replace the head of {1,2} with each element of a list:

Out[1]=1

Use the operator form of ComapApply:

Out[1]=1

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

Out[1]=1

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

Use explicit pure functions:

Out[1]=1
Out[2]=2

ComapApply can be used on expressions with any head:

Out[1]=1

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

Out[1]=1

Options  (1)Common values & functionality for each option

Heads  (1)

Apply inside the head as well as arguments:

Out[1]=1
Out[2]=2

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:

Out[1]=1

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

Out[2]=2

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

Out[1]=1
Out[2]=2

Compare this to the operator form of ComapApply:

Out[3]=3

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

Out[1]=1

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

Out[2]=2
Out[3]=3

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

Out[1]=1
Out[2]=2

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

Out[1]=1

Use ReleaseHold to allow evaluation to proceed:

Out[2]=2

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

Out[4]=4

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

Out[1]=1

The expression is evaluated first by default:

Out[2]=2

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

Out[1]=1

The expression is evaluated first by default:

Out[2]=2

ComapApply can be parallelized automatically:

Out[1]=1
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.

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 ]}

@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 ]}

@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 ]}