English

Generic Level Polymorphic N-ary Functions

Programming Languages 2021-10-13 v1

Abstract

Agda's standard library struggles in various places with n-ary functions and relations. It introduces congruence and substitution operators for functions of arities one and two, and provides users with convenient combinators for manipulating indexed families of arity exactly one. After a careful analysis of the kinds of problems the unifier can easily solve, we design a unifier-friendly representation of n-ary functions. This allows us to write generic programs acting on n-ary functions which automatically reconstruct the representation of their inputs' types by unification. In particular, we can define fully level polymorphic n-ary versions of congruence, substitution and the combinators for indexed families, all requiring minimal user input.

Keywords

Cite

@article{arxiv.2110.06107,
  title  = {Generic Level Polymorphic N-ary Functions},
  author = {Guillaume Allais},
  journal= {arXiv preprint arXiv:2110.06107},
  year   = {2021}
}

Comments

Draft of the Tyde19 paper

R2 v1 2026-06-24T06:49:51.269Z