-
Notifications
You must be signed in to change notification settings - Fork 150
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
inlineCleanup
can create empty letrecs
#1025
Labels
Comments
Nah,
|
@christiaanb Is there a specific reason it wasn't accepting letrecs? |
@martijnbastiaan legacy reasons, we used to be stricter in our normal forms. You will have to call |
martijnbastiaan
added a commit
that referenced
this issue
Jan 24, 2020
martijnbastiaan
added a commit
that referenced
this issue
Jan 24, 2020
martijnbastiaan
added a commit
that referenced
this issue
Jan 24, 2020
martijnbastiaan
added a commit
that referenced
this issue
Jan 25, 2020
martijnbastiaan
added a commit
that referenced
this issue
Jan 25, 2020
martijnbastiaan
added a commit
that referenced
this issue
Jan 31, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following pseudo-code (due to GHC optimizations I can't write a small example that triggers this behavior):
Thanks to #984 this will be turned into:
inlineCleanup
will then remove the binderb
, because it is unused:Leaving us with an
EmptyRec
. If this is forced in a blackbox, Clash will crash withForced to evaluate unexpected function argument
. For this particular case, we can patchinlineCleanup
to omit a let if it has no bindings:In general, I'm not sure what to do. Should we assign the letrec to a var before passing it to a blackbox?
The text was updated successfully, but these errors were encountered: