Fun
Input: Fun(x, x**2)
$$x \mapsto {x}^{2}$$Defines a univariate function mapping the symbol given as the first argument to the expression in the second argument. The symbol $x$ representing the dummy variable becomes locally bound within the function expression. This function is improper; that is, it does not belong to a particular function space.
Input: Fun(x, x**2)(42)
$$\left(x \mapsto {x}^{2}\right)(42)$$Calling a named function.
$$f(42)\; \text{ where } f(x) = {x}^{2}$$
Calling a function assigned to a variable.
$$\left(x, y\right) \mapsto 2 x + 3 y$$
Defines a bivariate function. The symbols x and y become locally bound.
$$\left(x\right) \mapsto {x}^{2}$$
Equivalent to defining a univariate function.
$$\left(x_{1}, x_{2}, \ldots, x_{n}\right) \mapsto \sum_{i=1}^{n} i x_{i}$$
Defines a multivariate function with arity $n$. In this special case, the variable binding x_ in the scope of the Tuple call propagates through to the Fun operator.
$$g\!\left(c_{2}, c_{3}\right)\; \text{ where } c_{n} = {n}^{2} + n + 1,\;g\!\left(x, y\right) = \left(x + y\right) \left(x - y\right)$$
Defining and calling named improper functions in the context of a Where-expression.
Last updated: 2020-03-06 00:22:16