LeoColman
04/28/2020, 8:09 PMfun <A> Arb<A>.orNull(nullChance: Double = 0.25): Arb<A?> = arb(this.edgecases().plus(null as A?)) { rs ->
sequence {
while (true)
yield(if (rs.random.nextDouble() <= nullChance) null else this@orNull.next(rs))
}
}