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

Feature/core constructor #349

Merged
merged 11 commits into from
Dec 11, 2023
Merged

Feature/core constructor #349

merged 11 commits into from
Dec 11, 2023

Conversation

b-studios
Copy link
Collaborator

@b-studios b-studios commented Dec 11, 2023

This PR special cases constructors in core. This way, it is trivial for backends to detect whether a PureApp is a constructor call or not. In consequence, all remaining PureApps are FFI calls, which nicely stratifies things.

case Pure.Make(dataType, ctorTag, vargs) =>
clauses.collectFirst { case (tag, lit) if tag == ctorTag => lit }
.map(body => app(body, Nil, vargs, Nil))
.orElse { default }.getOrElse { sys error "Should not happen" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a case-of-known-case analysis that was dear to my heart :)

@b-studios b-studios merged commit 8778ec0 into master Dec 11, 2023
2 checks passed
@b-studios b-studios deleted the feature/core-constructor branch December 11, 2023 18:29
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.

None yet

1 participant