Profunctor optics are bidirectional data accessors that capture data transformation patterns such as accessing subfields or iterating over containers. They are modular, meaning that we can construct accessors for complex structures by combining simpler ones. Profunctor optics have been studied only using Sets as the enriching category and in the nonmixed case. However, functional programming languages are arguably better described by enriched categories and we have found that some structures in the literature are actually mixed optics. Our work generalizes a classic result by Pastro and Street on Tambara theory and uses it to describe mixed V-enriched profunctor optics and to endow them with V-category structure. We provide some original families of optics and derivations, including an elementary one for traversals that solves an open problem posed by Milewski. Finally, we discuss a Haskell implementation.
Lenses may be characterised as objects in the category of algebras over a monad, however they are often understood instead as morphisms, which propagate updates between systems. Working internally to a category with pullbacks, we define lenses as simultaneously functors and cofunctors between categories. We show that lenses may be canonically represented as a particular commuting triangle of functors, and unify the classical state-based lenses with both c-lenses and d-lenses in this framework. This new treatment of lenses leads to considerable simplifications that are important in applications, including a clear interpretation of lens composition.
Lenses are an important tool in applied category theory. While individual lenses have been widely used in applications, many of the mathematical properties of the corresponding categories of lenses have remained unknown. In this paper, we study the category of small categories and asymmetric delta lenses, and prove that it has several good exactness properties. These properties include the existence of certain limits and colimits, as well as so-called imported limits, such as imported products and imported pullbacks, which have arisen previously in applications. The category is also shown to be extensive, and it has an image factorisation system.
Lenses are a mathematical structure for maintaining consistency between a pair of systems. In their ongoing research program, Johnson and Rosebrugh have sought to unify the treatment of symmetric lenses with spans of asymmetric lenses. This paper presents a diagrammatic approach to symmetric lenses between categories, through representing the propagation operations with Mealy morphisms. The central result of this paper is to demonstrate that the bicategory of symmetric lenses is locally adjoint to the bicategory of spans of asymmetric lenses, through constructing an explicit adjoint triple between the hom-categories.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.