manipulate the function’s definition. An example of a
linear functor that uses OneArgFunctor appears in
Figure 6.
The decoupling of client from function has two
consequences. First, functors over the same domain can
be interchanged without affecting a compatible client. For
example, given a linear functor mapping real numbers to
real numbers (e.g. f t k k t 0 1 ( ) = + ), we can change the
particular linear function in use by manipulating the
parameters (in this case, 0 k and 1 k ) that define the
function. Alternatively, a quadratic functor (such as
2
0 1 2 f (t) = k + k t + k t ) can be substituted for the
linear functor. In both cases, the client continues to work
without modification.
Second, a given functor can be used with any
compatible client. For example, a functor embodying a
Fermat spiral over 2D space can be used by any client that
conforms to the evaluation interface. The client is free to
interpret the function as navigating any pair of
parameters, such as x and y-coordinates, hue and
saturation, or saturation and x-coordinate.
Functors can be constructed to encapsulate functions
that compute non-numeric values, such as strings, discrete
symbols, visual objects, and so on.
It is also possible to construct functors that embody
functions of multiple arguments, such as
2
1 2 0 1 1 f (t ,t ) = k t + k t .