pub struct FnDecl {
pub name: String,
pub type_params: Vec<String>,
pub params: Vec<Param>,
pub effects: Vec<Effect>,
pub effect_row_var: Option<String>,
pub return_type: TypeExpr,
pub body: Block,
pub examples: Vec<Example>,
pub leading_comments: Vec<String>,
}Fields§
§name: String§type_params: Vec<String>§params: Vec<Param>§effects: Vec<Effect>§effect_row_var: Option<String>Optional open-row tail on the declared effect row (effect-row poly):
-> [io, net | E] T names a row variable E (one of type_params)
standing for “plus any further effects”, making the function
effect-row-polymorphic. None for the usual closed row. Serialized
only when present so pre-feature signatures (and their SigId content
hashes) stay byte-identical.
return_type: TypeExpr§body: Block§examples: Vec<Example>Optional examples { call(a, b) => expected, ... } block (#369).
Each case binds the function on literal-or-pure arguments and
declares the value the body is expected to produce. Pure-only in
v1: a function carrying examples must declare no effects.
Serialized as an empty Vec so the JSON shape stays compatible
with pre-#369 signatures when the block is absent.
leading_comments: Vec<String>Comments immediately preceding this fn declaration. See
Import for semantics.