Sized generation produces test values through a size-indexed generator: given a size, it returns an ordinary generator for values at that size. Rather than first finding any failure and then reducing it, a test runner can begin with small, simple cases and increase size and complexity until a property fails. This makes the earliest failure a useful candidate for the smallest failing case. section 8.2 section 8.6
The separation is deliberate. An SGen decides how to generate a value for one requested size; the property runner decides which sizes to test and how many cases to allocate to each. Generators therefore need not know the search schedule, while the runner remains free to use a sequential schedule or make larger jumps through sizes. section 8.2
A size-indexed list generator
Represent an SGen[A] as Int => Gen[A]. An ordinary Gen[A] can be lifted by ignoring the size. To generate lists whose length follows the requested size, map each n to listOfN(n). A nonempty variant uses n.max(1), allowing properties such as finding the maximum of a generated nonempty integer list.
