I found that the ?LET macro interferes with the resize combinator in recursive generators.
This is an example
my_list(Gen) ->
?SIZED(Size, if Size == 0 -> [];
true -> [Gen | resize(Size - 1, my_list(Gen))]
end).
my_list1(Gen) ->
?SIZED(Size, if Size == 0 -> [];
true -> [Gen | resize(Size - 1, ?LET(Xs, my_list1(Gen), Xs))]
end).
The function my_list is able to generate lists but my_list1 halts.
It looks like the size used by the generator inside ?LET corresponds to the outer size and not to the size computed by resize.
Expected Behaviour:
I would expect these generators to be equivalent.
Environment
- PropEr version: 1.5.0
- Erlang/OTP version: 28.0