Affiliation:
1. University of Iowa, USA
Abstract
Dependently typed languages are well known for having a problem with code reuse. Traditional non-indexed algebraic datatypes (e.g. lists) appear alongside a plethora of indexed variations (e.g. vectors). Functions are often rewritten for both non-indexed and indexed versions of essentially the same datatype, which is a source of code duplication.
We work in a Curry-style dependent type theory, where the same untyped term may be classified as both the non-indexed and indexed versions of a datatype. Many solutions have been proposed for the problem of dependently typed reuse, but we exploit Curry-style type theory in our solution to not only reuse data and programs, but do so at zero-cost (without a runtime penalty). Our work is an exercise in dependently typed generic programming, and internalizes the process of zero-cost reuse as the identity function in a Curry-style theory.
Funder
U.S. Department of Defense
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference25 articles.
1. Bruno Barras and Bruno Bernardo. 2008. The implicit calculus of constructions as a programming language with dependent types. Foundations of Software Science and Computational Structures (2008) 365–379. Bruno Barras and Bruno Bernardo. 2008. The implicit calculus of constructions as a programming language with dependent types. Foundations of Software Science and Computational Structures (2008) 365–379.
2. Type-theory in color
3. Idris, a general-purpose dependently typed programming language: Design and implementation
4. Safe zero-cost coercions for Haskell
5. Transporting functions across ornaments
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Zero-Cost Constructor Subtyping;IFL 2020: Proceedings of the 32nd Symposium on Implementation and Application of Functional Languages;2020-09-02
2. A Weakly Initial Algebra for Higher-Order Abstract Syntax in Cedille;Electronic Proceedings in Theoretical Computer Science;2019-10-12
3. A role for dependent types in Haskell;Proceedings of the ACM on Programming Languages;2019-07-26
4. QED at Large: A Survey of Engineering of Formally Verified Software;Foundations and Trends® in Programming Languages;2019
5. Deriving via: or, how to turn hand-written instances into an anti-pattern;ACM SIGPLAN Notices;2018-12-07