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

Enhance the core transformation to strictify let pattern matching #2337

Merged
merged 7 commits into from
Sep 16, 2024

Conversation

facundominguez
Copy link
Collaborator

This PR makes more effective a transformation in the code to rewrite

let pat = e0 in e1

to

case e0 of
  pat = e1

A new case is handled, and the transformation is constrained to apply only in cases where it doesn't break the type of the transformed expression.

Much of the challenge is that when we get to transform core, the lazy patterns have already been desugared to a bunch of lets which use projections instead. See the documentation of strictifyLazyLets for details.

The Isort.hs test had to be disabled as explained in #2335.

This PR is related to #2257. It doesn't address that issue, but it makes more predictable how LH will transform core. Fixing #2257 would require documenting the transformation to the user.

@facundominguez facundominguez merged commit e53f2a6 into develop Sep 16, 2024
4 checks passed
@facundominguez facundominguez deleted the fd/rewrite-lazy-lets branch September 16, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant