mitch
09/26/2020, 9:04 PMsam
09/26/2020, 9:05 PMmitch
09/26/2020, 9:34 PMsam
09/26/2020, 9:44 PMmitch
09/26/2020, 9:47 PMprivate fun <A, B, C> Gen<A>.bind(other: Gen<B>, fn: (A, B) -> C): Arb<C> {
val arb = when (this) {
is Arb -> this
is Exhaustive -> this.toArb()
}
return arb.flatMap { a ->
when (other) {
is Arb -> other.map { fn(a, it) }
is Exhaustive -> other.toArb().map { fn(a, it) }
}
}
}
sam
09/26/2020, 9:53 PMmitch
09/26/2020, 11:41 PMsam
09/27/2020, 12:05 AMmitch
09/27/2020, 12:17 AMsam
09/27/2020, 12:17 AM