Closed Armael closed 6 years ago
Looks good, especially for porting tests from other APIs.
I'm not convinced by fix combinators in general, though. They get very ugly when you try mutual recursion. There was some discussion in #5 about this.
Yes, that's why I wouldn't advocate for completely replacing unlazy
by general fixpoint combinators. But in the common case of a single recursive definition, I think it's simple and convenient enough to add it.
Thanks!
This is an attempt at defining a simple
fix
combinator, wrapping the use of lazy/unlazy for defining recursive generators.It does not covers the case of mutually recursive definitions, but should already be useful (e.g. for porting the tests to the current API -- coming in the next PR).