Skip to content
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

Add total to #let-bindings where LHS is a variable #3798

Merged
merged 9 commits into from
Nov 14, 2023
Merged

Conversation

Baltoli
Copy link
Contributor

@Baltoli Baltoli commented Nov 8, 2023

This PR addresses an issue whereby the Booster reverts to the old Haskell backend when it encounters a rule written using #let bindings. The reason for this is that the de-sugared form of #let is expressed in terms of an intermediate #lambda function that is not marked as being total.

To address the issue, this PR adds the total attribute to the desugared intermediate lambda function for let-bindings and anonymous functions when the left-hand side of the original binding is a variable.

Points to consider when reviewing this PR:

  • Is the identification of when the LHS a variable correct in its handling of semantic casts and sorting? My presumption is that it is given that the "first child of #SemanticCastTo KApply" logic is replicated elsewhere.
  • Is there a way to integration-test this change other than "it doesn't break the rest of the test suite"? At the moment I'm not sure there is an obvious way to do so, but I'm open to suggestions.

Fixes #3715

@Baltoli Baltoli marked this pull request as ready for review November 8, 2023 14:39
@Baltoli Baltoli requested a review from radumereuta November 14, 2023 11:00
@rv-jenkins rv-jenkins merged commit fb08dee into develop Nov 14, 2023
8 checks passed
@rv-jenkins rv-jenkins deleted the let-total branch November 14, 2023 13:08
@Baltoli Baltoli mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants