# Profunctor

**Definition.** A *profunctor* $(P,<,>)$ between two categories $𝔸$ and $𝔹$ is a family of sets $P(A,B)$ indexed by objects $𝔸$ and $𝔹$, and endowed with jointly functorial left and right actions of the morphisms of $𝔸$ and $𝔹$, respectively.

Explicitly, types of these actions are $(>) \colon \hom(A’,A) \times P(A’,B) \to P(A,B)$, and $(<) \colon \hom(B,B’) \times P(A,B) \to P(A,B’)$. These must satisfy

- compatibility, $(f > p) < g = f > (p < g)$,
- preserve identities, $id > p = p$, and $p < id = p$,
- and composition, $(p < f) < g = p < (f ⨾ g)$ and $f > (g > p) = (f ⨾ g) > p$.

More succintly, a profunctor $P \colon 𝔸 \to 𝔹$ is a functor $P \colon 𝔸^{op} × 𝔹 \to \mathbf{Set}$. When presented as a family of sets with a pair of actions, profunctors are sometimes called bimodules.

See also:

#index