This is a minor thing, but I find myself writing StreamData.one_of([nil, some_other_generator]) quite a lot. Would there be interest in a PR that adds a StreamData.maybe/1 generator that makes another generator nilable?
Of course, there's a discussion about what the right distribution of values should be here. The simple one_of from above makes it so that nil is returned 50% of the time, which may or may not be the desired outcome. Feedback welcome!
This is a minor thing, but I find myself writing
StreamData.one_of([nil, some_other_generator])quite a lot. Would there be interest in a PR that adds aStreamData.maybe/1generator that makes another generator nilable?Of course, there's a discussion about what the right distribution of values should be here. The simple
one_offrom above makes it so thatnilis returned 50% of the time, which may or may not be the desired outcome. Feedback welcome!