(patch) Add the satisfy function.
All checks were successful
/ Build and Test Library Snapshot (pull_request) Successful in 2m10s
All checks were successful
/ Build and Test Library Snapshot (pull_request) Successful in 2m10s
This commit is contained in:
parent
a74f30f912
commit
abb0e26292
1 changed files with 10 additions and 0 deletions
|
@ -52,6 +52,16 @@ object Datagen:
|
|||
*/
|
||||
def gen(): A = generate(())
|
||||
|
||||
/** Satisfy the target generator (that requires input) using this generator
|
||||
* to provide that input.
|
||||
*
|
||||
* @param target
|
||||
* The target generator.
|
||||
* @return
|
||||
* The new input-satisfied generator.
|
||||
*/
|
||||
def satisfy[B](target: Datagen[B, A]): Gen[B] = target.toGen(gen())
|
||||
|
||||
def flatMap[B](f: A => NoInput[B]): NoInput[B] =
|
||||
new NoInput.Defer[B](() => f(generate(())).generate(()))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue