filter -package:Cabal -package:aeson -package:base -package:bytestring package:hedgehog

Generates a value that satisfies a predicate. Shrinks of the generated value will also satisfy the predicate. From the original generator's shrink tree, any values that fail the predicate will be removed, but any subsequent shrinks that satisfy it will be retained. Compared to filter, shrinking may be slower but will be optimal. It's possible that the predicate will never pass, or will only pass at a larger size than we're currently running at. To avoid looping forever, we limit the number of retries, and grow the size with each retry. If we retry too many times then the whole generator is discarded.
Returns a tree containing only elements that match the predicate. If the root of the tree does not match the predicate then Nothing is returned.
Generates a value that satisfies a predicate. Shrinks of the generated value will also satisfy the predicate. From the original generator's shrink tree, any values that fail the predicate will be removed, along with their subsequent shrinks. Compared to filter, shrinking may be faster but may also be less optimal. The type is also more general, because the shrink behavior from filter would force the entire shrink tree to be evaluated when applied to an impure tree. This is essentially:
filterT p gen = mfilter p gen <|> filterT p gen
But that could loop forever, if the predicate will never pass or will only pass at a larger size than we're currently running at. We differ from the above in keeping some state to avoid that. We limit the number of retries, and grow the size with each retry. If we retry too many times then the whole generator is discarded.
Returns a tree containing only elements that match the predicate. If the root of the tree does not match the predicate then Nothing is returned.
Returns a tree containing only elements that match the predicate. When an element does not match the predicate its node is replaced with empty.