Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/content/3.10/ends-and-coends.tex
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,17 @@ \section{Profunctor Composition}
Let's explore further the idea that a profunctor describes a relation
--- more precisely, a proof-relevant relation, meaning that the set
$p\ a\ b$ represents the set of proofs that $a$ is related
to $b$. If we have two relations $p$ and $q$ we can
to $b$. If we have two relations $p$ and $q$, we can
try to compose them. We'll say that $a$ is related to $b$
through the composition of $q$ after $p$ if there exist an
intermediary object $c$ such that both $q\ b\ c$ and
$p\ c\ a$ are non-empty. The proofs of this new relation are all
intermediary object $c$ such that both $q\ a\ c$ and
$p\ c\ b$ are non-empty. The proofs of this new relation are all
pairs of proofs of individual relations. Therefore, with the
understanding that the existential quantifier corresponds to a coend,
and the Cartesian product of two sets corresponds to ``pairs of
proofs,'' we can define composition of profunctors using the following
formula:
\[(q \circ p)\ a\ b = \int^c p\ c\ a\times{}q\ b\ c\]
\[(q \circ p)\ a\ b = \int^c p\ c\ b\times{}q\ a\ c\]
Here's the equivalent Haskell definition from
\code{Data.Profunctor.Composition}, after some renaming:

Expand Down