According to Wikipedia:
Let C and D be categories. A functor F from C to D is a mapping that
- associates to each object $X$ in C an object $F(X)$ in D,
- associates to each morphism $f : X \rightarrow Y$ in C a morphism $F(f) : F(X) \rightarrow F(Y)$ in D such that the following two conditions hold:
- $F(id_X) = id_{F(X)}$ for every object $X$ in C
- $F(g \circ f)$ = $F(g) \circ F(f)$ for all morphisms $f : X \rightarrow Y$ and $g : Y \rightarrow Z$ in C.
That is, functors must preserve identity morphisms and composition of morphisms.
Maybe this is because of my programming background, but it's not clear what is $F$ in this definition. It looks like a function, but it always takes different arguments: $F(X)$ – object, $F(f)$ – morphism.
It looks like a very smart function that accepts all kinds of arguments and knows what to return in each case.
Moreover, in this book there is one more equation that makes thing even more complicated:
$$F(f : X \rightarrow Y) = F(f) : F(X) \rightarrow F(Y)$$
Does it mean that if we pass a function $f : X \rightarrow Y$ to $F$, we will get a function $F(f) : F(X) \rightarrow F(Y)$?
Also, shall $F$ mentioned here: $F(f : X \rightarrow Y)$ and here: $F(X)$ to be two different functions with different signatures and behavior?
[]orMaybe) and thefmapfunction (the morphism mapping). The well-knownmapfunction in many languages is a combination of the mapping of a function to another function on lists, along with the application of that function on a list. – chepner Aug 14 '16 at 19:54operator()' a lot more than set theory does. – Aug 15 '16 at 07:11