Generic Zero-Cost Reuse for Dependent Types

03/21/2018
by   Larry Diehl, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/02/2018

Zero-Cost Coercions for Program and Proof Reuse

We introduce the notion of identity coercions between non-indexed and in...
research
03/19/2019

Elaborating Inductive Datatypes and Course-of-Values Pattern Matching to Cedille

In CDLE, a pure Curry-style type theory, it is possible to generically d...
research
11/17/2020

Learning functional programs with function invention and reuse

Inductive programming (IP) is a field whose main goal is synthesising pr...
research
08/04/2021

Partial Reuse AMG Setup Cost Amortization Strategy for the Solution of Non-Steady State Problems

The partial reuse algebraic multigrid (AMG) setup cost amortization stra...
research
02/01/2019

Separating Use and Reuse to Improve Both

Context: Trait composition has inspired new research in the area of code...
research
05/22/2023

TEIMMA: The First Content Reuse Annotator for Text, Images, and Math

This demo paper presents the first tool to annotate the reuse of text, i...
research
03/01/1999

An Algebraic Programming Style for Numerical Software and its Optimization

The abstract mathematical theory of partial differential equations (PDEs...

Please sign up or login with your details

Forgot password? Click here to reset