A completely unique account of enumeration

Publication date

2022

Authors

van der Rest, Cas
Swierstra, WouterORCID 0000-0002-0295-7944ISNI 0000000426852359

Editors

Advisors

Supervisors

Document Type

/dk/atira/pure/researchoutput/researchoutputtypes/contributiontojournal/conferencearticle
Open Access logo

License

cc_by

Abstract

How can we enumerate the inhabitants of an algebraic datatype? This paper explores a datatype generic solution that works for all regular types and indexed families. The enumerators presented here are provably both complete and unique—they will eventually produce every value exactly once—and fair—they avoid bias when composing enumerators. Finally, these enumerators memoise previously enumerated values whenever possible, thereby avoiding repeatedly recomputing recursive results.

Keywords

Citation

van der Rest, C & Swierstra, W 2022, 'A completely unique account of enumeration', Proceedings of the ACM on Programming Languages, vol. 6, 105, pp. 411–437. https://doi.org/10.1145/3547636