Reflecting on Random Generation
summary
Presents reflective generators that combine free generators + partial monadic profunctors so a generator can run “backwards” to recover random choices that could produce a value. Implements interpretations on top of Freer/QuickCheck Gen, adds lmap/prune annotations (often lenses/prisms), and converts a BST generator to reflect, check, and extract a choice trace. Demonstrates choice-based shrinking, example-based reweighting (Inputs from Hell extension), and property tests for soundness/completeness; prototypes succeed on BST examples and related demos, artifacts available.
AI-written summary · about
chapters (6)
- 0:00Free generators intro
- 2:05Bidirectional programs & profunctors
- 8:21Combining generators & logic
- 12:16Reflective generators intro
- 18:54Correctness & limits
- 22:03Q&A
related talks
15mTuning Random Generators: Property-Based Testing as Probabilistic Programming
41mBuilding test check Generators
33mLets Generate Tests
32mGenerative Testing: Properties, State and Beyond
30mConstrained generation of well-typed programs
28mLanguage Support for Property-Based Testing
27mRANDOM DATA GENERATION WITH SCALACHECK
26mThe missing piece of testing
