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

Optimization: chain of application to Case Constr #6823

Open
SeungheonOh opened this issue Feb 5, 2025 · 0 comments
Open

Optimization: chain of application to Case Constr #6823

SeungheonOh opened this issue Feb 5, 2025 · 0 comments
Labels
status: needs triage GH issues that requires triage

Comments

@SeungheonOh
Copy link
Contributor

Describe the feature you'd like

(((\a b c -> a + b + c) 10) 20) 30 is more expensive than (case (constr 0 [10, 20, 30]) f) given we apply more than 3 arguments, so we can have transform that converts chained applications into this form.

This is one way of implementing it, but this could be simpler since this deals with some other stuff as well.
https://github.com/Plutonomicon/plutarch-plutus/blob/fd7d1c1fc173542f952f19272554027183659dd6/Plutarch/Internal/Term.hs#L705-L723

Describe alternatives you've considered

I read somewhere ApplyN is planned, so once we have that this will be outdated. Though, I think this transformer is simple and good to have enough till than.

@github-actions github-actions bot added the status: needs triage GH issues that requires triage label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage GH issues that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant