A completely unique account of enumeration

Journal Article (2022)
Author(s)

C.R. van der Rest (TU Delft - Programming Languages)

Wouter Swierstra (Universiteit Utrecht)

Research Group
Programming Languages
Copyright
© 2022 C.R. van der Rest, Wouter Swierstra
DOI related publication
https://doi.org/10.1145/3547636
More Info
expand_more
Publication Year
2022
Language
English
Copyright
© 2022 C.R. van der Rest, Wouter Swierstra
Research Group
Programming Languages
Issue number
ICFP
Volume number
6
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

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.