-
Notifications
You must be signed in to change notification settings - Fork 97
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
base: master
Are you sure you want to change the base?
Conversation
instead call into the new `@coerce_cont`.
src/ir_passes/async.ml
Outdated
varE r | ||
]) | ||
) | ||
varE (var "@coerce_and_cont" (unary_async --> ([k; fail] -->* (varE unary_async -*- tupE [varE unary_fulfill; varE fail])) |> typ)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
later I'll generate the rest
coerce t1 | ||
begin match T.normalize t1 with | ||
| T.Tup [] -> | ||
varE (var "@coerce_and_cont00" coerce_and_cont0T) -*- varE unary_async |
There was a problem hiding this comment.
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'))); |
There was a problem hiding this comment.
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
No description provided.