Record Updates in Coq
summary
Library coq-record-update implements record setters by generating per-field setters with Ltac and plugging that Ltac into type class resolution so Coq runs the generator on demand instead of requiring one instance per field. Implementation builds an ada expansion that deconstructs/reconstructs the record, uses eval hnf and eval pattern to substitute the target projection, special-cases setters that only depend on the field value, verifies the ada expansion is the identity to catch swapped-field errors, and offers notation, nested updates and an optional small OCaml plugin; code is on GitHub and installable via opam.
AI-written summary · about
chapters (10)
- 0:00Record updates in Coq
- 1:06How set is implemented
- 1:27Record fields with ada expansions
- 2:09Setter using ltac
- 3:53Type classes for setters
- 5:59Automating setters with hints
- 6:41Why instances work like hint DBs
- 7:03Improving UI with notations
- 8:30Reducing boilerplate with plugins
- 9:34Nested record updates & conclusion
