Skip to content

Conversation

@michaelpj
Copy link
Contributor

@michaelpj michaelpj commented Feb 2, 2022

This has bothered me for a while. We rely on this to turn function
applications into let-bindings so that we can inline them, but because
of the way it was written it could only ever do this for at most one
argument at a time! So we could only fully-inline a function of arity N
with N rounds of the simplifier! Terrible!

Now it handles any number at once.

I wrote all the functions for this while working on
#4365, since there we
really need it, since constructors and destructors appear like
multiple function arguments rather than multiple nested
immediately-applied-lambdas. But it applies well here too, so I thought
I'd just do this improvement on the side.

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@michaelpj michaelpj requested review from a user and bezirg February 2, 2022 14:58
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Nice 👍

This has bothered me for a while. We rely on this to turn function
applications into let-bindings so that we can inline them, but because
of the way it was written it could only ever do this for at most one
argument at a time! So we could only fully-inline a function of arity N
with N rounds of the simplifier! Terrible!

Now it handles any number at once.

I wrote all the functions for this while working on
#4365, since there we
*really* need it, since constructors and destructors appear like
multiple function arguments rather than multiple nested
immediately-applied-lambdas. But it applies well here too, so I thought
I'd just do this improvement on the side.
@michaelpj michaelpj merged commit a7ada9f into master Feb 4, 2022
MaximilianAlgehed pushed a commit to Quviq/plutus that referenced this pull request Mar 3, 2022
…ctMBO#4372)

This has bothered me for a while. We rely on this to turn function
applications into let-bindings so that we can inline them, but because
of the way it was written it could only ever do this for at most one
argument at a time! So we could only fully-inline a function of arity N
with N rounds of the simplifier! Terrible!

Now it handles any number at once.

I wrote all the functions for this while working on
IntersectMBO#4365, since there we
*really* need it, since constructors and destructors appear like
multiple function arguments rather than multiple nested
immediately-applied-lambdas. But it applies well here too, so I thought
I'd just do this improvement on the side.
@kwxm kwxm deleted the mpj/multi-beta branch November 10, 2022 13:28
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.

2 participants