Add a new argument to the definition of a function or a constant. The default value of the new argument is defined at the same level as the definition.
f x = x + 17
g z = z + f x
|
f y x = x + 17
f_y = undefined
g z = z + f f_y x
|
General comment:
The choice of the position where the argument is added
is not accidental: putting the argument at the
beginning of the argument list means that it can
be added correctly to any partial applications of
the function.
Left to right comment:
The default value given to the new parameter is
| Right to left comment:
An argument to a function can be removed if it is not used in the definition of the function.
In this example, the definition of |
Left to right conditions:
Adding the new formal parameter should not cause name capture/name clash. | Right to left conditions:
The argument to be removed should not be used in the definition of the function. |