Please feel free to move this question to another place:
I have been munching on Roc Editor Proposal document for some time and now I am burning midnight oil to complete first draft: and I am a bit hitting a brick wall with await
keyword.
Could please somebody give a bit refresher what does it do exactly? I do understand that it handles async mechanism for Tasks, but I can't categorize it, so maybe somebody can help me out here ...
How should I think about it?
It technically isn't a keyword at all. It is a function just like any other function
The most important part of await is that it takes a callback as an argument.
As such, await will give a task to the host. The host will run the task. Finally, the host will call the callback with any data from the running the task.
await : Task a err, (a -> Task b err) -> Task b err
:face_palm:
Thanks Brendan!
Zeljko Nesic has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC