Functional programmers have an established tradition of using traversals as a design pattern to work with recursive data structures. The technique is so prolific that a whole host of libraries have been designed to help in the task of automatically providing traversals by analysing the generic structure of data types. More recently, lenses have entered the functional scene and have proved themselves to be a simple and versatile mechanism for working with product types. They make it easy to focus on the salient parts of a data structure in a composable and reusable manner.
In this paper, we use the combination of lenses and traversals to give rise to an expressive and flexible library for querying and modifying complex data structures. Furthermore, since our lenses and traversals are based on the generic shape of data, we are able to use this information to produce code that is as efficient as hand-written versions. The technique leverages the structure of data to produce generic abstractions that are then eliminated by the standard workhorses of modern functional compilers: inlining and specialisation.
Tue 25 SepDisplayed time zone: Guadalajara, Mexico City, Monterrey change
15:00 - 16:30 | Bidirectional ProgrammingResearch Papers at Stifel Theatre Chair(s): Wouter Swierstra Utrecht University, Netherlands | ||
15:00 22mTalk | What You Needa Know about Yoneda: Profunctor Optics and the Yoneda Lemma (Functional Pearl) Research Papers Guillaume Boisseau University of Oxford, Jeremy Gibbons Department of Computer Science, University of Oxford DOI | ||
15:22 22mTalk | Incremental Relational Lenses Research Papers Rudi Horn University of Edinburgh, Roly Perera University of Glasgow, James Cheney University of Edinburgh, UK DOI | ||
15:45 22mTalk | Synthesizing Quotient Lenses Research Papers Solomon Maina University of Pennsylvania, Anders Miltner Princeton University, Kathleen Fisher Tufts University, USA, Benjamin C. Pierce University of Pennsylvania, Dave Walker Princeton University, Steve Zdancewic University of Pennsylvania DOI | ||
16:07 22mTalk | Generic Deriving of Generic Traversals Research Papers Csongor Kiss Imperial College London, Matthew Pickering University of Bristol, Nicolas Wu University of Bristol, UK DOI |