In an article I am writing, I am led to the following generalization of the notion of functor. Let $C$ and $D$ and be two categories. A generalized functor $F : C \to D$ is given by:

- a function $f : C_0 \to D_0$
- for all $c \in C_0$, a set $F_c$
- for all $c_1,c_2 \in C_0$, a function $F_{c_1,c_2}:C(c_1,c_2) \times F_{c_2} \to F_{c_1} \times D(f(c_1),f(c_2))$.

All this must be compatible with the product and units, that is:

- for all $c \in C$ and all $x \in F_c$, $F_{c,c} (1_c, x) = (x,1_{f(c)})$
- for all $c_1,c_2,c_3 \in C$, the following composites are equal:

$$C(c_1,c_2) \times C(c_2,c_3) \times F_{c_3} \to C(c_1,c_3) \times F_{c_3} \to F_{c_1} \times D(f(c_1),f(c_3)) $$ and $$C(c_1,c_2) \times C(c_2,c_3) \times F_{c_3} \to C(c_1,c_2) \times F_{c_2} \times D(f(c_2),f(c_3)) \to F_{c_1}\times D(f(c_1),f(c_2))\times D(f(c_2),f(c_3)) \to F_{c_1}\times D(f(c_1),f(c_3))$$

In particular, a functor is a generalized functor, where every $F_c$ is the singleton set.

**Are you aware of a similar structure arising somewhere?**

One way to see this structure is the following. One can see objects $a,b$ of a category as *points*, and then see $C(a,b)$ as an *arrow* form $a$ to $b$. If you say that the composition of two arrows is given by the Cartesian product, then you can see the composition in $C$ as a *$2$-arrow* from $C(a,b) \times C(b,c) \to C(a,c)$.

Now how do you represent a functor in this setting? You can't represent the function $C(a,b) \to D(f(a),f(b))$ by a $2$-arrow, because the 'arrows' $C(a,b)$ and $D(f(a),f(b))$ are not parallel (the first one goes from $a$ to $b$, while the second goes from $f(a)$ to $f(b)$).

One way to deal with that is to add two arrows: one called $F_{a}$ from $a$ to $f(a)$ and the other called $F_{b}$ from $b$ to $f(b)$. Now we have a square that we can fill with a $2$-arrow $F_{a,b}$.

If we keep in mind the correspondence 'arrows are sets' and '$2$-arrows are functions' from the previous paragraph, we obtain the definition of a generalized functor.

Two more things to note:

- One can define generalized natural transformations between generalised functors. The usual naturality arrows $\eta_a : f(a) \to g(a)$ are then replaced by functions $G_a \to F_a \times D(f(a),g(a))$:

- This can be extended to $n$-functors by replacing the sets $F_a$ by $(n-1)$-categories and the functions $F_{a,b}$ by $(n-1)$-functors.

does? $\endgroup$ – Jonathan Beardsley Mar 12 '15 at 13:20