Composition in a multi-category can be visualised as the gluing together of trees and is formalised using the free monoid monad. This then generalises to -categories for a suitable monad on a suitable category [1]. Another kind of composition of tree-like things comes with substitution of polynomial spans in a locally cartesian closed category [2]. There is a (weak) double category associated with each kind of composition and each of these has span-like horizontal maps. We'll define what it means to have a pseudo-distributive law for a (weak) double category over a (weak) double category and describe the (weak) double category of "mixed spans" which this always yields. We'll show that the -categories example arises this way and show how the polynomial example seems also to arise this way (some details are still being verified).
[1] Leinster, T. Higher Operads, Higher Categories. arXiv May 2, 2003. (link) [2] Gambino, N.; Kock, J. Polynomial Functors and Polynomial Monads. Math. Proc. Camb. Phil. Soc. 2013, 154 (1), 153–192.