Abstract
AbstractFunctional programmers from all horizons strive to use, and sometimes abuse, their favorite type system in order to capture the invariants of their programs. A widely used tool in that trade consists in defining finely indexed datatypes. Operationally, these types classify the programmer's data, following the ML tradition. Logically, these types enforce the program invariants in a novel manner. This new programming pattern, by which one programs over inductive definitions to account for some invariants, lead to the development of a theory of ornaments (McBride, 2011 Ornamental Algebras, Algebraic Ornaments. Unpublished). However, ornaments originate as a dependently-typed object and may thus appear rather daunting to a functional programmer of the non-dependent kind. This article aims at presenting ornaments from first-principles and, in particular, to declutter their presentation from syntactic considerations. To do so, we shall give a sufficiently abstract model of indexed datatypes by means of many-sorted signatures. In this process, we formalize our intuition that an indexed datatype is the combination of a data-structure and a data-logic. Over this abstraction of datatypes, we shall recast the definition of ornaments, effectively giving a model of ornaments. Benefiting both from the operational and abstract nature of many-sorted signatures, ornaments should appear applicable and, one hopes, of interest beyond the type-theoretic circles, case in point being languages with generalized abstract datatypes or refinement types.
Publisher
Cambridge University Press (CUP)
Reference42 articles.
1. Guibas L. J. & Sedgewick R. (1978) A dichromatic framework for balanced trees. In Foundations of Computer Science, pp. 8–21.
2. Ko H.-S. (2014) Analysis and Synthesis of Inductive Families. PhD Thesis, University of Oxford.
3. Coq development team. (2015) The Coq proof assistant reference manual.
Cited by
8 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Intrinsically-typed definitional interpreters à la carte;Proceedings of the ACM on Programming Languages;2022-10-31
2. Staged compilation with two-level type theory;Proceedings of the ACM on Programming Languages;2022-08-29
3. Deferring the details and deriving programs;Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development - TyDe 2019;2019
4. How to do proofs: practically proving properties about effectful programs' results (functional pearl);Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development - TyDe 2019;2019
5. QED at Large: A Survey of Engineering of Formally Verified Software;Foundations and Trends® in Programming Languages;2019