Relational Lenses as a Library (Demo)
summary
Claim: relational lenses run as a Haskell library by pushing the static checks into the type system rather than extending the compiler. Implementation uses type-level programming, GHC type literals, type families, type classes and constraints to verify functional dependencies and predicates at compile time. It implements the incremental relational lens semantics, composes primitive table lenses, select/join/drop and translates Links-style code, is about ~3000 lines of code, and is currently Postgres-only with basic error messages and no serial-column support.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:09Recap on Bi-Directional Transformations
- 1:05Relational Lenses
- 2:28Where Would Relational Lenses Typically Come in Use
- 13:41Constraint Table
- 16:47Functional Dependencies
- 17:05Functional Dependency
- 19:33Primitive Lens
- 20:06Select Lens
related talks
57mLet's Lens - Part 2 of 5
05mRelational Programming
27mMaking Relational Cool Again (or: JavaScript on ACID)
32mArel: The Ruby Relational Algebra Library
42mA Practical Functional Relational Architecture
35mComprehending queries over finite maps
30mtypedKanren: Statically Typed Relational Programming with Exhaustive Matching in(…)
21mA Typed Multi-Level Datalog IR and its Compiler Framework
