The Optics of Language-Integrated Query
J. L\'opez-Gonz\'alez, Juan M. Serrano

TL;DR
This paper introduces Optica, a language that integrates optics with LINQ to enhance data manipulation, enabling complex queries, updates, and interoperability with SQL and comprehension-based approaches.
Contribution
It formalizes optics within LINQ, creating a DSL called Optica, and demonstrates how optics can represent queries like XQuery and generate SQL, bridging different query paradigms.
Findings
Optica formalizes optics in LINQ with a dedicated DSL.
A subset of XQuery can be represented as an optic.
Optica enables generating SQL queries from optic expressions.
Abstract
Monadic comprehensions reign over the realm of language-integrated query (LINQ), and for good reasons. Indeed, comprehensions are tightly integrated with general purpose programming languages and close enough to common query languages, such as SQL, to guarantee their translation into effective queries. Comprehensions also support features for writing reusable and composable queries, such as the handling of nested data and the use of functional abstractions. In parallel to these developments, optics have emerged in recent years as the technology of choice to write programs that manipulate complex data structures with nested components. Optic abstractions are easily composable and, in principle, permit both data access and updates. This paper attempts to exploit the notion of optic for LINQ as a higher-level language that complements comprehension-based approaches. In order to do this, we…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
