maybe package:registry-hedgehog

Generates a Nothing some of the time.
Create a default generator for a Maybe, choosing evenly between Nothing and Just
Add a generator for an optional element
Fails the test if the Maybe is Nothing, otherwise returns the value in the Just.
Fails the test if the action throws an exception, or if the Maybe is Nothing, otherwise returns the value in the Just.
Generates a value which is the result of the given function returning a Just. The original generator's shrink tree will be retained, with values returning Nothing removed. Subsequent shrinks of those values will be retained. Compared to mapMaybeT, shrinking may be slower but will be optimal. It's possible that the function will never return Just, or will only do so 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.
Generates a value which is the result of the given function returning a Just. The original generator's shrink tree will be retained, with values returning Nothing removed. Subsequent shrinks of those values will be retained. Compared to mapMaybeT, shrinking may be slower but will be optimal. The type is also more general, because the shrink behavior from mapMaybe would force the entire shrink tree to be evaluated when applied to an impure tree. It's possible that the function will never return Just, or will only do so 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.