Reference. Profunctor Optics: Modular Data Accessors

Cite

Cite as @pickering-2017-profunctor (helia, typst) · \cite{pickering-2017-profunctor} (LaTeX)
BibTeX
bibtex · 1 line
@article{pickering-2017-profunctor, title={Profunctor Optics: Modular Data Accessors}, volume={1}, ISSN={2473-7321}, url={http://dx.doi.org/10.22152/programming-journal.org/2017/1/7}, DOI={10.22152/programming-journal.org/2017/1/7}, number={2}, journal={The Art, Science, and Engineering of Programming}, publisher={Aspect-Oriented Software Association (AOSA)}, author={Pickering, Matthew and Gibbons, Jeremy and Wu, Nicolas}, year={2017}, month=Apr }
hayagriva YAML (typst)
yaml · 18 lines
pickering-2017-profunctor:
  type: article
  title: 'Profunctor Optics: Modular Data Accessors'
  author:
  - Pickering, Matthew
  - Gibbons, Jeremy
  - Wu, Nicolas
  date: 2017-04
  url: http://dx.doi.org/10.22152/programming-journal.org/2017/1/7
  serial-number:
    doi: 10.22152/programming-journal.org/2017/1/7
    issn: 2473-7321
  parent:
    type: periodical
    title: The Art, Science, and Engineering of Programming
    publisher: Aspect-Oriented Software Association (AOSA)
    issue: 2
    volume: 1
Cited by (8)

On a fibrational construction for optics, lenses, and Dialectica categories capucci-2024-onx

Categories of lenses/optics and Dialectica categories are both comprised of bidirectional morphisms of basically the same form. In this work we show how they can be considered a special case of an overarching fibrational construction, generalizing Hofstra’s construction of Dialectica fibrations and Spivak’s construction of generalized lenses. This construction turns a tower of Grothendieck fibrations into another tower of fibrations by iteratively twisting each of the components, using the opposite fibration construction.
DOI · arXiv

Profunctor Optics, a Categorical Update clarke-2024-profunctor

Optics are bidirectional data accessors that capture data transformation patterns such as accessing subfields or iterating over containers. Profunctor optics are a particular choice of representation supporting modularity, meaning that we can construct accessors for complex structures by combining simpler ones. Profunctor optics have previously been studied only in an unenriched and non-mixed setting, in which both directions of access are modelled in the same category. 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, with access directions modelled in different categories. 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. Finally, we discuss a Haskell implementation.
DOI · arXiv

Fundamental Components of Deep Learning: A category-theoretic approach gavranovicFundamentalComponentsDeep

Deep learning, despite its remarkable achievements, is still a young field. Like the early stages of many scientific disciplines, it is marked by the discovery of new phenomena, ad-hoc design decisions, and the lack of a uniform and compositional mathematical foundation. From the intricacies of the implementation of backpropagation, through a growing zoo of neural network architectures, to the new and poorly understood phenomena such as double descent, scaling laws or in-context learning, there are few unifying principles in deep learning. This thesis develops a novel mathematical foundation for deep learning based on the language of category theory. We develop a new framework that is a) end-to-end, b) unform, and c) not merely descriptive, but prescriptive, meaning it is amenable to direct implementation in programming languages with sufficient features. We also systematise many existing approaches, placing many existing constructions and concepts from the literature under the same umbrella. In Part I we identify and model two main properties of deep learning systems parametricity and bidirectionality by we expand on the previously defined construction of actegories and Para to study the former, and define weighted optics to study the latter. Combining them yields parametric weighted optics, a categorical model of artificial neural networks, and more. Part II justifies the abstractions from Part I, applying them to model backpropagation, architectures, and supervised learning. We provide a lens-theoretic axiomatisation of differentiation, covering not just smooth spaces, but discrete settings of boolean circuits as well. We survey existing, and develop new categorical models of neural network architectures. We formalise the notion of optimisers and lastly, combine all the existing concepts together, providing a uniform and compositional framework for supervised learning.
DOI

The Game Semantics of Game Theory hedges-2023-the

DOI · arXiv

Fibre optics braithwaite-2021-fibre

Lenses, optics and dependent lenses (or equivalently morphisms of containers, or equivalently natural transformations of polynomial functors) are all widely used in applied category theory as models of bidirectional processes. From the definition of lenses over a finite product category, optics weaken the required structure to actions of monoidal categories, and dependent lenses make use of the additional property of finite completeness (or, in case of polynomials, even local cartesian closure). This has caused a split in the applied category theory literature between those using optics and those using dependent lenses. The goal of this paper is to unify optics with dependent lenses, by finding a definition of fibre optics admitting both as special cases.
arXiv

Morphisms of Open Games hedges-2018-morphisms

DOI · arXiv

What you needa know about Yoneda: profunctor optics and the Yoneda lemma (functional pearl) boisseau-2018-what

Profunctor optics are a neat and composable representation of bidirectional data accessors, including lenses, and their dual, prisms. The profunctor representation exploits higher-order functions and higher-kinded type constructor classes, but the relationship between this and the familiar representation in terms of “getter” and “setter” functions is not at all obvious. We derive the profunctor representation from the concrete representation, making the relationship clear. It turns out to be a fairly direct application of the Yoneda Lemma, arguably the most important result in category theory. We hope this derivation aids understanding of the profunctor representation. Conversely, it might also serve to provide some insight into the Yoneda Lemma.
PDF · DOI · pldb

Compositional Game Theory ghani-2018-compositional

DOI · arXiv
Cites 36 works (3 here)
With notes (3)

The essence of the Iterator pattern gibbons-2009-the

The Iterator pattern gives a clean interface for element-by-element access to a collection, independent of the collection’s shape. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating . Various existing functional models of iteration capture one or other of these aspects, but not both simultaneously. We argue that C. McBride and R. Paterson’s applicative functors (Applicative programming with effects, J. Funct. Program. , 18 (1): 1–13, 2008), and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the Iterator pattern. Moreover, they do so in a way that nicely supports modular programming. We present some axioms for traversal, discuss modularity concerns and illustrate with a simple example, the wordcount problem.
PDF · DOI · pldb

Applicative programming with effects mcbride-2008-applicative

In this article, we introduce Applicative functors – an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this article, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation that interprets the normal application syntax in the idiom of an Applicative functor. Furthermore, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrow.
PDF · DOI · pldb

Datatype-Generic Programming gibbons-2007-datatype

DOI
External (33)
pickering-2017-profunctor reference entries/refs/pickering-2017-profunctor/pickering-2017-profunctor.hel