Profunctor optics, a categorical update

by   Bryce Clarke, et al.

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 π’πžπ­π¬ as the enriching category and in the non-mixed 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.


page 1

page 2

page 3

page 4

βˆ™ 01/22/2020

Profunctor optics and traversals

Optics are bidirectional accessors of data structures; they provide a po...
βˆ™ 01/31/2021

Commutative Monads for Probabilistic Programming Languages

A long-standing open problem in the semantics of programming languages s...
βˆ™ 05/21/2019

Complete Positivity for Mixed Unitary Categories

In this article we generalize the ^∞-construction of dagger monoidal cat...
βˆ™ 04/20/2022

Dependent Optics

A wide variety of bidirectional data accessors, ranging from mixed optic...
βˆ™ 07/02/2022

On Structuring Functional Programs with Monoidal Profunctors

We study monoidal profunctors as a tool to reason and structure pure fun...
βˆ™ 11/25/2002

Monadic Style Control Constructs for Inference Systems

Recent advances in programming languages study and design have establish...

Please sign up or login with your details

Forgot password? Click here to reset