r/ProgrammingLanguages • u/Vraliance • Oct 15 '26
Truly Colorless Functions in Sabre
https://sabre.rroessler.io/blog/design-01-truly-colorless-functions
13
Upvotes
r/ProgrammingLanguages • u/Vraliance • Oct 15 '26
15
u/initial-algebra Oct 15 '26
This is pretty much the same problem all effect systems face. "await" is an effect, and what you call a policy is a handler for the "await" effect. I assume the default policy is to block, while the
asyncpolicy passes through the caller's policy (usually, this would be the default, and blocking would be an explicit policy, but that's more a matter of taste).2
u/pthierry Oct 16 '26
Wait, if functions don't have a color, what happens if you synchronously call a function that does things asynchronously?