Info: Zenodo’s user support line is staffed on regular business days between Dec 23 and Jan 5. Response times may be slightly longer than normal.

There is a newer version of the record available.

Published July 22, 2022 | Version v2
Conference paper Open

Datatype-Generic Programming Meets Elaborator Reflection

  • 1. Hsiang-Shang
  • 2. Liang-Ting
  • 3. Tzu-Chi

Description

Datatype-generic programming is natural and useful in dependently typed languages such as Agda. However, datatype-generic libraries in Agda are not reused as much as they should be, because traditionally they work only on datatypes decoded from a library’s own version of datatype descriptions; this means that different generic libraries cannot be used together, and they do not work on native datatypes, which are preferred by the practical Agda programmer for better language support and access to other libraries. Based on elaborator reflection, we present a framework in Agda featuring a set of general metaprograms for instantiating datatype-generic programs as, and for, a useful range of native datatypes and functions —including universe-polymorphic ones— in programmer-friendly and customisable forms. We expect that datatype-generic libraries built with our framework will be more attractive to the practical Agda programmer. As the elaborator reflection features used by our framework become more widespread, our design can be ported to other languages too.

Files

README.md

Files (2.9 GB)

Name Size Download all
md5:f24fe1475cb9658c531753097b582c46
4.6 MB Download
md5:1bf55e3003fddd250d1321249613630d
10.7 kB Preview Download
md5:28b282d23c1b20255b4cada14c10aeaf
2.9 GB Download