gleamunison/inference
Values
pub fn check_linearity(
term: ast.Term,
cache: types.TypeCache,
) -> Result(Nil, types.InferenceError)
pub fn collect_requirements(
term: ast.Term,
cache: types.TypeCache,
) -> List(ast.ReqElement)
Collect the abilities a term’s evaluation may perform: abilities named
by Do nodes on the evaluation spine, minus those bound by an enclosing
Handle, plus the declared requirements of referenced definitions.
Deliberate under-approximation: we do not descend into nested Lambda
bodies (an unapplied closure performs nothing), and locally-bound
closures called later are not tracked. Documented in docs/adr (effects
are dynamic by design); the requirement set is a lower bound.
pub fn infer_term(
term: ast.Term,
cache: types.TypeCache,
) -> Result(ast.Type, types.InferenceError)