Generic Deriving of Generic Traversals

05/17/2018
by   Csongor Kiss, et al.
0

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.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

10/10/2018

Using ACL2 in the Design of Efficient, Verifiable Data Structures for High-Assurance Systems

Verification of algorithms and data structures utilized in modern autono...
01/02/2020

Using Nesting to Push the Limits of Transactional Data Structure Libraries

Transactional data structure libraries (TDSL) combine the ease-of-progra...
12/31/2018

Generic Programming in OCaml

We present a library for generic programming in OCaml, adapting some tec...
05/31/2019

Tracking in Order to Recover: Recoverable Lock-Free Data Structures

We present the tracking approach for deriving recoverable implementation...
09/18/2012

Writing Reusable Digital Geometry Algorithms in a Generic Image Processing Framework

Digital Geometry software should reflect the generality of the underlyin...
08/28/2019

Performance Analysis of Zippers

A zipper is a powerful technique of representing a purely functional dat...
02/04/2022

Generative Modeling of Complex Data

In recent years, several models have improved the capacity to generate s...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.