Salvato in:
| Autori principali: | , , , , , , |
|---|---|
| Natura: | Preprint |
| Pubblicazione: |
2020
|
| Soggetti: | |
| Accesso online: | https://arxiv.org/abs/2001.07488 |
| Tags: |
Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
|
| _version_ | 1866913458823364608 |
|---|---|
| author | Clarke, Bryce Elkins, Derek Gibbons, Jeremy Loregian, Fosco Milewski, Bartosz Pillmore, Emily Román, Mario |
| author_facet | Clarke, Bryce Elkins, Derek Gibbons, Jeremy Loregian, Fosco Milewski, Bartosz Pillmore, Emily Román, Mario |
| contents | 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. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2001_07488 |
| institution | arXiv |
| publishDate | 2020 |
| record_format | arxiv |
| spellingShingle | Profunctor Optics, a Categorical Update Clarke, Bryce Elkins, Derek Gibbons, Jeremy Loregian, Fosco Milewski, Bartosz Pillmore, Emily Román, Mario Programming Languages Category Theory 18C50 D.3.1 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. |
| title | Profunctor Optics, a Categorical Update |
| topic | Programming Languages Category Theory 18C50 D.3.1 |
| url | https://arxiv.org/abs/2001.07488 |