-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let binding cyclic value detection is stronger than top level #2322
Comments
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick Summary:
Top level definitions allow cyclic values to be declared when the recursive call is guarded behind a lambda.
In let bindings however, they're disallowed more strongly, based on whether the binding itself has arguments. This is a different algorithm, and forbids working programs.
SSCCE
This works (as per the bad-recursion document)
While this doesn't
Even though these definitions are semantically identical.
Additional Details
Code in question is
checkCycles
inCanonicalize.Expression
.This is overly strict and could instead use the
toNodeOne
andtoNodeTwo
approach fromCanonicalize.Module
.While the above example is indeed liftable to the top level, not all let bindings are, and the alternative (to put everything in the let behind a function call, means potentially a lot of extra computation may occur.
The text was updated successfully, but these errors were encountered: