  Various models of $(\infty,1)$-categories, including quasi-categories,
complete Segal spaces, Segal categories, and naturally marked simplicial sets
can be considered as the objects of an $\infty$-cosmos. In a generic
$\infty$-cosmos, whose objects we call $\infty$-categories, we introduce
modules (also called profunctors or correspondences) between
$\infty$-categories, incarnated as as spans of suitably-defined fibrations with
groupoidal fibers. As the name suggests, a module from $A$ to $B$ is an
$\infty$-category equipped with a left action of $A$ and a right action of $B$,
in a suitable sense. Applying the fibrational form of the Yoneda lemma, we
develop a general calculus of modules, proving that they naturally assemble
into a multicategory-like structure called a virtual equipment, which is known
to be a robust setting in which to develop formal category theory. Using the
calculus of modules, it is straightforward to define and study pointwise Kan
extensions, which we relate, in the case of cartesian closed $\infty$-cosmoi,
to limits and colimits of diagrams valued in an $\infty$-category, as
introduced in previous work.
