Generic level polymorphic N-ary functions

Research output: Chapter in Book/Report/Conference proceedingConference contribution book

10 Downloads (Pure)


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.
Original languageEnglish
Title of host publicationTyDe 2019 - Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development, co-located with ICFP 2019
EditorsDavid Darais, Jeremy Gibbons
Place of PublicationNew York
Number of pages13
Publication statusPublished - 18 Aug 2019
Event4th ACM SIGPLAN International Workshop on Type-Driven Development - Berlin, Germany
Duration: 18 Aug 201918 Aug 2019


Workshop4th ACM SIGPLAN International Workshop on Type-Driven Development
Abbreviated titleTyDe'19
Internet address


  • dependently typed functional type
  • Agda formalization
  • arity-generic programming
  • universe polymorphism


Dive into the research topics of 'Generic level polymorphic N-ary functions'. Together they form a unique fingerprint.

Cite this