Could you then imagine a keyword similar to rethrows with the meaning that a function will become async in case it is passed an async function? Is there prior art for such a reasyncs functionality?
Yeah, this is a general property of things that can be treated as effects. Along these same lines, if we introduced pure functions, we could also have "re-impure" functions that are as pure as their closure arguments, and likewise for compiler-evaluable and other transitive concepts. It's a lot of complexity, but I think it would be good to turn this all into a formal effect system of some form eventually.
Wow, now I sort of get what is meant by an ‘effects system’ - thanks!
Thanks for the explanation! Sounds like the concept of pure functions could provide some huge optimization possibilities for function composition.