Functions, Bindings, And Annotations
Current implementation evidence: examples/pure-capability.0x0,
docs/language.html, and docs/documentation.html.
Function Shape
Functions use ƒ:
(ƒ add
(∷ (→ I64 I64 I64))
(cap pure)
(doc "Return the sum of two integers without effects.")
(a b)
(+ a b))
The parameter list appears after annotations. The function body follows the
parameter list.
Type Annotations
∷ carries the current checked source contract:
(∷ (→ I64 I64 I64))
The current checker validates the implemented slice:
- arrow form uses
→; - annotation arity matches parameter count when the return type is concrete;
- typed 0x0 function calls use declared arity;
- simple
I64,Text,Bool, andUnitmismatches are rejected when inferred.
This is not a complete type system. Complex unresolved cases remain permissive.
Documentation Annotations
doc annotations describe public functions:
(doc "Return the sum of two integers without effects.")
The compiler parses and skips doc annotations for output behavior. The API
documentation generator reads them for public docs.
Bindings
Use ≔ for local names:
(≔ ((sum (+ 20 22)))
sum)
The compiler validates that local symbols resolve to parameters or earlier
bindings.
Practical Habit
Write public functions with type, capability, and doc annotations when the
function belongs to a library or framework. Keep local helpers documented when
their representation choices are not obvious.