Keith wrote:

> [Bartosz Milewski]( gives composition of profunctors as a coend,

> \\[
> (\Phi\circ\Psi)(x,z) = \int^{y\text{ in }Y}\Phi(x,y)\otimes\Psi(y,z),
> \\]

>but for \\(\mathbf{Bool}\\)-profunctors we have

> \\[
>(\Phi\circ\Psi)(x,z) = \exists_{y\text{ in }Y}.\Phi(x,y) \land \Psi(y,z),
> \\]

Yes, good point! As you suggest, these are two special cases of something a bit more general.

Bartosz is composing profunctors between _categories_, and above you are composing functors between _\\(\mathbf{Bool}\\)-enriched categories_. In Lecture 63 we will see how to compose profunctors between _categories enriched over commutative quantales_. These include \\(\mathbf{Bool}\\)-enriched categories as a special case... but not categories!

So, to get a generalization that covers the two examples you just gave, we'd need to go a bit higher, and consider profunctor between _categories enriched over closed cocomplete symmetric monoidal categories_.

We may not reach that level of generality in this course. But that's the right level of generality for fully understanding enriched profunctors. Sums, existential quantifiers, colimits and coends are all special cases of 'weighted colimits'. Basically they're all ways to think about _addition_.

This seems like a fun introduction to these issues, but learning this stuff takes real work:

* Fosco Loregian, [This is the (co)end, my only (co)friend](

Nice reference to the Doors song!