✨ Add call_by_need#277
Merged
Merged
Conversation
elbeno
force-pushed
the
call-by-need
branch
2 times, most recently
from
September 23, 2025 22:50
7086d55 to
a4afd05
Compare
elbeno
marked this pull request as draft
September 24, 2025 16:21
elbeno
force-pushed
the
call-by-need
branch
from
September 24, 2025 17:10
a4afd05 to
832370c
Compare
elbeno
marked this pull request as ready for review
September 24, 2025 17:10
elbeno
force-pushed
the
call-by-need
branch
4 times, most recently
from
September 29, 2025 16:34
fa15e63 to
f2241c1
Compare
Problem: - Function call is asymmetric: it allows many arguments, but only one return value. - Higher-order asynchronous functions like `async::then` deal with calling multiple functions and forwarding multiple results; they don't have any building-blocks to work with. Solution: - Add `call_by_need` which, given a tuple of functions and a tuple of arguments, calls the functions as is possible, returning their results and passing on any unused arguments.
elbeno
force-pushed
the
call-by-need
branch
from
September 29, 2025 17:11
f2241c1 to
bb7e789
Compare
mjcaisse-intel
approved these changes
Sep 30, 2025
mjcaisse-intel
left a comment
Contributor
There was a problem hiding this comment.
looking forward to the sender!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
async::thendeal with calling multiple functions and forwarding multiple results; they don't have any building-blocks to work with.Solution:
call_by_needwhich, given a tuple of functions and a tuple of arguments, calls the functions as is possible, returning their results and passing on any unused arguments.