@@ -804,7 +804,7 @@ the ``@yields`` attribute. A yielded value may have a convention attribute,
804
804
taken from the set of parameter attributes and interpreted as if the yield
805
805
site were calling back to the calling function.
806
806
807
- Currently, a coroutine may not have normal results.
807
+ In addition to yielded values a coroutine could also have normal results.
808
808
809
809
Coroutine functions may be used in many of the same ways as normal
810
810
function values. However, they cannot be called with the standard
@@ -6330,6 +6330,16 @@ callee function (and thus said signature). Instead:
6330
6330
``@inout_aliasable `` parameter convention is used when a ``@noescape ``
6331
6331
closure captures an ``inout `` argument.
6332
6332
6333
+ **Coroutines ** ``partial_apply `` could be used to create closures over
6334
+ coroutines. Overall, the ``partial_apply `` of a coroutine is straightforward: it
6335
+ is another coroutine that captures arguments passed to the ``partial_apply ``
6336
+ instruction. This closure applies the original coroutine (similar to the
6337
+ ``begin_apply `` instruction) for yields (suspend) and yields the resulting
6338
+ values. Then it calls the original coroutine continuation for return or unwind,
6339
+ and forwards the results (if any) to the caller as well. Currently only the
6340
+ autodiff transformation produces ``partial_apply `` for coroutines while
6341
+ differentiating modify accessors.
6342
+
6333
6343
**NOTE: ** If the callee is generic, all of its generic parameters must be bound
6334
6344
by the given substitution list. The arguments are given with these generic
6335
6345
substitutions applied, and the resulting closure is of concrete function type
0 commit comments