Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Functional Programming >

Operate

Operate[p, f[x, y]]
gives p[f][x, y].
Operate[p, expr, n]
applies p at level n in the head of expr.
  • Operate[p, f[x]] effectively applies the functional operator p to the function f.
  • Operate is essentially a generalization of Apply, which allows you to apply an operator to the head of an expression, rather than simply to replace the head.  »
Operate on the head of the expression with p:
Use a pure function:
Operate on the head of the expression with p:
In[1]:=
Click for copyable input
Out[1]=
 
Use a pure function:
In[1]:=
Click for copyable input
Out[1]=
Operate at level 1, the head of the expression (default):
Operate at level 2 (the head of the head of the expression):
Operate can be iterated:
Apply is a special case of Operate that replaces the head of the expression:
Operate followed by Through is a form of composition:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team