Abstract
Ornaments are a way to describe changes in datatype definitions reorganizing, adding, or dropping some pieces of data so that functions operating on the bare definition can be partially and sometimes totally lifted into functions operating on the ornamented structure. We propose an extension of ML with higher-order ornaments, demonstrate its expressiveness with a few typical examples, including code refactoring, study the metatheoretical properties of ornaments, and describe their elaboration process. We formalize ornamentation via an a posteriori abstraction of the bare code, returning a generic term, which lives in a meta-language above ML. The lifted code is obtained by application of the generic term to well-chosen arguments, followed by staged reduction, and some remaining simplifications. We use logical relations to closely relate the lifted code to the bare code.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Focusing on Refinement Typing;ACM Transactions on Programming Languages and Systems;2023-12-20
2. Datatype-generic programming meets elaborator reflection;Proceedings of the ACM on Programming Languages;2022-08-29
3. References;Concepts and Semantics of Programming Languages 2;2021-08-05
4. LoCal: a language for programs operating on serialized data;Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation;2019-06-08
5. Deferring the details and deriving programs;Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development - TyDe 2019;2019