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

[sc-525] Float combinators not extracting some terms #245

Merged

Conversation

imaqtkatt
Copy link
Contributor

No description provided.

@imaqtkatt imaqtkatt requested a review from developedby March 27, 2024 14:25
@imaqtkatt imaqtkatt self-assigned this Mar 27, 2024
Copy link

This pull request has been linked to Shortcut Story #525: float_combinators not extracting some terms.

Copy link
Member

@developedby developedby left a comment

Choose a reason for hiding this comment

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

Can you add a test for recursiveness/combinators in other positions? Like in different application positions, in adt matches and num matches, both in arms and as argument. In lists, tuples, sups, lets, dups, etc.

Also some positions where it should not get extracted, like the body of a lambda (eg foo = @a @b @c (foo a))

Also, update the documentation for this pass to explain the new logic, including the exceptions where we don't float.

src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
@imaqtkatt imaqtkatt requested a review from developedby March 27, 2024 19:45
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Show resolved Hide resolved
term_info.merge_scope(arg_scope);

detach
/// A term is a supercombinator if it is a lambda abstraction without free variables.
Copy link
Member

Choose a reason for hiding this comment

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

This is not quite the definition of a supercombinator. This is just a lambda abstraction that is also a combinator, which is all we need here in this case. To be a supercombinator we require that it is of the form

@x1 @x2 ... @xN (Arg1 Arg2 ... ArgM)

Where Arg1-M are also supercombinators, constants or one of the x1-N.

src/term/transform/float_combinators.rs Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
@imaqtkatt imaqtkatt requested a review from developedby March 28, 2024 18:41
Copy link
Member

@developedby developedby left a comment

Choose a reason for hiding this comment

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

Remember to update the documentation

src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
src/term/transform/float_combinators.rs Outdated Show resolved Hide resolved
@imaqtkatt imaqtkatt requested a review from developedby March 28, 2024 20:04
@imaqtkatt imaqtkatt requested a review from developedby March 28, 2024 22:12
Copy link
Member

@developedby developedby left a comment

Choose a reason for hiding this comment

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

Great job

@developedby developedby added this pull request to the merge queue Mar 29, 2024
Merged via the queue into main with commit 817aec9 Mar 29, 2024
5 checks passed
@developedby developedby deleted the bug/sc-525/float-combinators-not-extracting-some-terms branch March 29, 2024 08:35
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