Dependently Typed Folds for Nested Data Types

06/13/2018
by   Peng Fu, et al.
0

We present an approach to develop folds for nested data types using dependent types. We call such folds dependently typed folds, they have the following properties. (1) Dependently typed folds are defined by well-founded recursion and they can be defined in a total dependently typed language. (2) Dependently typed folds do not depend on maps, map functions and many terminating functions can be defined using dependently typed folds. (3) The induction principles for nested data types follow from the definitions of dependently typed folds and the programs defined by dependently typed folds can be formally verified. (4) Dependently typed folds exist for any nested data types and they can be specialized to the traditional higher-order folds. Using various of examples, we show how to program and reason about dependently typed folds. We also show how to obtain dependently typed folds in general and how to specialize them to the corresponding higher-order folds.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/16/2023

Towards an induction principle for nested data types

A well-known problem in the theory of dependent types is how to handle s...
research
08/15/2018

An infinitary rewriting interpretation of coinductive types

We introduce an infinitary rewriting semantics for strictly positive nes...
research
03/28/2022

How Functorial Are (Deep) GADTs?

It is well-known that GADTs do not admit standard map functions of the k...
research
04/10/2023

Defunctionalization with Dependent Types

The defunctionalization translation that eliminates higher-order functio...
research
09/10/2020

Theory Exploration Powered By Deductive Synthesis

Recent years have seen tremendous growth in the amount of verified softw...
research
05/07/2021

GADTs, Functoriality, Parametricity: Pick Two

GADTs can be represented either as their Church encodings à la Atkey, or...
research
07/02/2022

LibNDT: Towards a Formal Library on Spreadable Properties over Linked Nested Datatypes

Nested datatypes have been widely studied in the past 25 years, both the...

Please sign up or login with your details

Forgot password? Click here to reset