Composition of compostion as a functor
Consider

(.) :: (a -&gt; b) -&gt; (d -&gt; a) -&gt; d -&gt; b


is the fmap for functor $F_d\colon \mathfrak{C} \rightarrow d/\mathfrak{C}$ from category of types $\mathfrak{C}$ to its coslice category $d/\mathfrak{C}$ on object $d$.  Similarly,

(.) :: ((d -&gt; a) -&gt; d -&gt; b) -&gt; (c -&gt; d -&gt; a) -&gt; c -&gt; d -&gt; b


is considered the fmap for functor $G_c\colon d/\mathfrak{C} \rightarrow c/\big(d/\mathfrak{C}\big)$.

These two functor can be composed to get $G_c \circ F_d\colon \mathfrak{C} \rightarrow c/\big(d/\mathfrak{C}\big)$. Like all compositions of two functors, the fmap of the composed functor is the composition of fmap its two functor operands. In this case, the fmap of $G_c \circ F_d$ is

(.) . (.) :: (a -&gt; b) -&gt; (c -&gt; d -&gt; a) -&gt; c -&gt; d -&gt; b


as in the opening question.