Given the following code:
this assertion failure is generated by `(gen/sample entities-and-relations-gen)`:
ClojureScript, 1.9.293
Clojure, 1.8.0
Mac OS X, running on Node.js v 6.9.1
It looks like you have an error where you're using a (gen/list-distinct ...) expression on the RHS of the gen/let and calling it relations-gen, even though it will be a generated value at that point and not a generator.
Does this make sense?
No, `relations-gen` is in fact a generator (`gen/list-distinct ...` returns a generator).
See:
(gen/list-distinct ...) evaluates to a generator, yes, but when you put a generator on the RHS of gen/let, then the LHS is bound to one of the generated values. Just like entity-set-gen evaluates to a generator but entity-set is not a generator.
Looking at it closer I imagine what you want here is just to collapse the second and third clauses:
Does this do what you want?
Doh! I see.
Yep, that does it. I think I've been too accustomed to using promesa's `alet` which allows both bindings within and [regular] without the monadic context (but I think that might not be possible for `gen/let`).