3 ms·
Related work: Functional Enumeration of Algebraic Data Types - https://mengwangoxf.github.io/Papers/Haskell12.pdf https://mengwangoxf.github.io/Papers/Haskell12
by rictic 2y ago
Related work: Functional Enumeration of Algebraic Data Types - https://mengwangoxf.github.io/Papers/Haskell12.pdf https://mengwangoxf.github.io/Papers/Haskell12.pdf
It's quite efficient, able to generate the 10^100th element in ~a second on 2013 hardware. It also groups the generated values by size, so you can e.g. randomly sample among ASTs with N nodes.