ifigueroap / racket-quickcheck

Quickcheck Clone implemented in Racket
Other
32 stars 16 forks source link

Make bind-generators consistently lazy #40

Closed laelath closed 1 year ago

laelath commented 3 years ago

Currently bind-generators isn't lazy on the first binding, and isn't lazy on the body if there are no bindings. This PR changes this to make bind-generators lazy in all cases. This does change the behavior from being exactly that of nested calls to generator-bind, but I think that it is less confusing to be consistently lazy in all cases.

This also fixes an exponential code duplication issue with bind-generators that I can split into a different pull request if the behavior change is undesired.