(module closure (fn apply (doc "apply a fn-of-Int to an Int") (type (fn-type (params (fn-type (params (con Int)) (ret (con Int))) (con Int)) (ret (con Int)))) (params f x) (body (app f x))) (fn main (doc "captures `n` from the enclosing let, returns 42") (type (fn-type (params) (ret (con Unit)) (effects IO))) (params) (body (let n 3 (do io/print_int (app apply (lam (params (typed x (con Int))) (ret (con Int)) (body (app + x n))) 39))))))