(module hof (fn inc (doc "increment by one") (type (fn-type (params (con Int)) (ret (con Int)))) (params x) (body (app + x 1))) (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 (type (fn-type (params) (ret (con Unit)) (effects IO))) (params) (body (app print (app apply inc 41)))))