fn(expr$0, bound$1) =>
match $0 {
#variable(v$2) =>
match @core.number-list-contains(list: $1, value: $2.variable_id, index: 0) {
true =>
[],
false =>
[$2.variable_id]
},
#let(l$3) =>
@core.list-concat(
left: @core.free-variables(expr: $3.value, bound: $1),
right: @core.free-variables(expr: $3.body, bound: @core.list-concat(left: [$3.variable_id], right: $1))
),
#function(f$4) =>
@core.free-variables(
expr: $4.body,
bound: @core.list-concat(left: @core.function-parameter-ids(parameters: $4.parameters, index: 0), right: $1)
),
#match(m$5) =>
@core.list-concat(
left: @core.free-variables(expr: $5.target, bound: $1),
right: @core.free-variables-in-arms(arms: $5.arms, index: 0, bound: $1)
),
_$6 =>
@core.free-variables-in-list(items: @core.expression-children(expr: $0), index: 0, bound: $1)
}