Function disciplines (pure, async, task)
Function modifiers declare constraints and concurrency behavior:
pure fnfor side-effect-free functions (checker-enforced subset)async fnfor promise-producing functionstask fnfor task-producing functionsconst fnfor compile-time-evaluable functions (see const functions)
Full reference: function disciplines.
Examples#
pure fn add (x: int, y: int) -> int {
return x + y;
}
task fn worker (x: int) -> int {
return x + 1;
}
See also#
- Full reference: function disciplines
- Concurrency: concurrency
Source repository · Edit this page · View Markdown