Directories: A Convenient and Well-Behaved Formalism for Hierarchical Organization in Categorical Systems Theory
Owen Lynch, Markus Lohmayer
TL;DR
This paper addresses the problem of providing a strict, human-readable hierarchical organization for categorical structures. It introduces directories as a polynomial-monad-inspired framework and lifts them to a $2$-monad on $\mathsf{Cat}$, yielding $2$-algebras equivalent to cocartesian, cartesian, or symmetric monoidal categories, while remaining strictly indexed by path-like names. The main contributions are the construction of the $Dtry$ monad, the non-empty subdirectory invariant via $\text{Record}_{\neq \emptyset}$, and the path-indexed analogue of the Fam construction supported by a concrete Haskell implementation. Together, these developments offer a strict, named alternative to coherence-heavy monoidal formalisms and enable practical programming paradigms for hierarchical systems such as EPHS.
Abstract
This paper introduces an inherently strict presentation of categories with products, coproducts, or symmetric monoidal products that is inspired by file systems and directories. Rather than using nested binary tuples to combine objects or morphisms, the presentation uses named tuples. Specifically, we develop 2-monads whose strict 2-algebras are product categories, coproduct categories, or symmetric monoidal categories, in a similar vein to the classical Fam construction, but where the elements of the indexing set are period-separated identifiers like $\mathtt{cart.motor.momentum}$. Our development of directories is also intended to serve the secondary purpose of expositing certain aspects of polynomial monads, and is accompanied by Haskell code that shows how the mathematical ideas can be implemented.
