Expand description
Effect tracking — E-AIR pass.
Tracks algebraic-effect usage through the call graph. Verifies that
declared effect clauses (with Log, Clock) match the effects actually
used or propagated from called functions.
§Algorithm
- Collect — all top-level function declarations are entered into a map together with their declared effect clause.
- Infer — for each function, actual effects are collected by walking
the body for
EffectOpinvocations and calls to other known functions. - Propagate — effects from called functions are added to the caller’s inferred set (one-level; declaration map is built in phase 1).
- Check — declared vs inferred effects are compared per strictness:
Sketchmode: auto-infer (no diagnostics emitted).Developmentmode: warn for undeclared effects on public functions.Productionmode: error for undeclared effects on all functions.
§Effect-Capability Correlation
IO effects correlate with capabilities (e.g. Log → Io.Stdout,
Http → Io.Network). The correlation is recorded as a note on
the diagnostic for consumption by downstream passes.
Structs§
- Effect
Ref - A reference to an algebraic effect, identified by its fully-qualified name.
Enums§
- Strictness
- Graduated strictness level for effect checking.
Functions§
- infer_
effects - Infer the effects used in a function node without checking declarations.
- track_
effects - Track effect usage through the call graph of
moduleand emit diagnostics according tostrictness.