Bind typed source functions with exact effect contracts during deterministic specialization; retain nominal operation identity and ordinary AIR verification. Add spec/RFC/grammar, checked Quick Reference examples, source/AIR conformance, package/hosted CLI tests, scheduler/GC coverage and documentation budgets.
10 lines
491 B
Rust
10 lines
491 B
Rust
// expect: run
|
|
// result: 42
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md §18
|
|
module test.static_functions
|
|
struct Policy<F: fn(Policy<fn F>) -> u64 effects []> { value: u64 }
|
|
fn selected(value: Policy<fn selected>) -> u64 effects [] { return value.value; }
|
|
fn apply<F: fn(Policy<fn F>) -> u64 effects []>(value: Policy<fn F>) -> u64 effects [] { return F(value); }
|
|
fn main() -> u64 effects [] { let value = Policy::<fn selected> { value: 42 }; return apply::<fn selected>(value); }
|