Function values and closures
A function is a value. Lambdas capture by reading, and every call site is resolved while the program compiles.
Lambdas and higher-order functions
A fn-typed parameter takes a lambda, written x -> expr, or a named function. Two or more parameters take brackets, (a, b) -> expr, and none at all is () -> expr. map, filter and fold in std/arrays are ordinary generic functions with such a parameter.
Every use is monomorphized, so no function value survives to run time in any backend.
Stored functions
A fn type is storable: a binding, a record field, an array, module state. A lambda that reads an outer local carries a copy of that local, taken where the lambda is written.
The implementation is defunctionalization: one closed enum per signature, one variant per lambda, and every call a direct call. There are no function pointers in the output.