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

improve n-ary continuation coercion #4615

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

improve n-ary continuation coercion #4615

wants to merge 8 commits into from

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented Jul 14, 2024

No description provided.

varE r
])
)
varE (var "@coerce_and_cont" (unary_async --> ([k; fail] -->* (varE unary_async -*- tupE [varE unary_fulfill; varE fail])) |> typ))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually this is for 0-ary continuations (impedance matching to unary, with unit)

Can we improve below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, we really get pairs etc., not only unit. Fixing...

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something wrong with the original code? The replacement actually seems way more convoluted. I would revert, tbh.

@ggreif ggreif requested a review from crusso July 14, 2024 20:00
coerce t1
begin match T.normalize t1 with
| T.Tup [] ->
varE (var "@coerce_and_cont00" coerce_and_cont0T) -*- varE unary_async
Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like this case never gets hit

@@ -66,6 +66,9 @@ actor a {
Prim.debugPrint a;
Prim.debugPrint b;
};
Prim.debugPrint (debug_show (await p()));
Prim.debugPrint (debug_show (await async (1, "two", '3')));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to exercise the higher tuples too

@ggreif ggreif self-assigned this Jul 26, 2024
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