Consider a value: 1 (a humble abstract symbol that represents a single entity of a type).

Let's perform an operation using the value 1, such as: 1 + 1 (which is important to note as equivalent to 2, but I digress).

There are other values that exist, such as 2 or 3, on which we can perform an operation using the same operator (such as 2 or 3 in the operation: 2 + 3).

Thus, we can abstract rules among operations and use letters to denote any value that it is defined to represent. For example, let x represent any scalar value. Hence x + x represents an addition operation between two instances of the same abstract value (which in this case can be shortened to 2x, which is a pattern that applies to any one-dimensional value (ie. x + x = 2x in the domain of scalars)).

Let's collect operations on values (parameters) and label them with a name, and call this concept: functions. Therefore we can label an operation 2x + 3 with a name 'F' and specify the parameters that are operated on (which in this case is only one and is called x). The shorthand notation of such a definition would be:

                                    F(x) = 2x + 3

Now we can perform operations such as composition and inversion on previously-defined functions or even use names to represent abstract yet-to-be defined functions.

Following the patterns of abstraction illustrated, what is a further level of abstraction over functions called? And maybe even the name of the abstraction over the abstraction?

  • $\begingroup$ they're called functions. What do you mean with abstraction? $\endgroup$ – Jens Renders Mar 24 '16 at 19:17

If you mean "abstraction" in the sense of your first example, going from something specific like $2+3$ to $x+y$ and understanding that $+$ just represents an operation which has been defined between two objects, $x$ and $y$, then functions follow this exact same pattern.

You may have two specific functions such as $f(x) = x + 1$ and $g(x) = 2x+3$. Their sum is a new function $h(x)=(x+1) + (2x+3) = 3x + 4$.

But you can just as easily find the sum of two arbitrary functions $f$ and $g$ from $\mathbb{R} \rightarrow \mathbb{R}$, which is defined as

$$ (f+g)(x) = f(x) + g(x) $$

  • $\begingroup$ Aha, the keyword was "arbitrary", or "higher-order", as I now know they're called. Thanks! $\endgroup$ – MathuSum Mut Mar 24 '16 at 22:07
  • 1
    $\begingroup$ @MathuSumMut Just to be clear, "arbitrary function" is not a synonym to "higher-order function." A higher-order function specifically refers to a function which takes another function as an input. I chose to frame my example in terms of arbitrary (random) functions from the real numbers to the real numbers, though you certainly don't have to choose just functions from the reals to the reals. You can also, as just one example, take arbitrary functions that map from the set of continuous real valued functions to the real numbers. These functions would be examples of higher-order functions. $\endgroup$ – wgrenard Mar 24 '16 at 22:26
  • $\begingroup$ Oh, thanks for the clarification. $\endgroup$ – MathuSum Mut Mar 24 '16 at 23:22
  • $\begingroup$ Is a functor an abstraction over the types operated upon by functions? $\endgroup$ – MathuSum Mut Apr 16 '16 at 12:12
  • $\begingroup$ @MathuSumMut I'm not familiar with functors, and a cursory read over the Wikipedia page on them doesn't make me feel that I can adequately answer your question without further research. Perhaps you should post as a separate question :) $\endgroup$ – wgrenard Apr 16 '16 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.