Skip to content
Main site
Language CoreM2.7

Functions & Monomorphic Inference

Explicit signatures, order-independent fixed-point inference, recursion, and exhaustive return checking.

5 min readUpdated: v0.8.0-rc Reference

Defining Functions

Functions are declared with fn (or fonksiyon/islev). Non-void functions are verified to return on every control-flow path. HADID's M2.7 inference pass collects call/return evidence across the program regardless of declaration order.

hadid · EN
fn fib(n: i32): i32 {    if (n <= 1) { return n; }    return fib(n - 1) + fib(n - 2);}fn describe_fib(k: i32): string {    return "fib(" + json_from_i64(k) + ") = " + json_from_i64(fib(k));}print(describe_fib(10));