{
  "schema": "ailang/v0",
  "name": "fn_with_lambda",
  "imports": [],
  "defs": [
    {
      "kind": "fn",
      "name": "make_adder",
      "doc": "Curried adder: takes an Int and returns an Int -> Int closure. Exercises TermLam and Type::Fn appearing as a return type.",
      "type": {
        "k": "fn",
        "params": [ { "k": "con", "name": "Int" } ],
        "param_modes": ["own"],
        "ret": {
          "k": "fn",
          "params": [ { "k": "con", "name": "Int" } ],
          "param_modes": ["own"],
          "ret": { "k": "con", "name": "Int" },
          "ret_mode": "own",
          "effects": []
        },
        "ret_mode": "own",
        "effects": []
      },
      "params": ["x"],
      "body": {
        "t": "lam",
        "params": ["y"],
        "param-types": [ { "k": "con", "name": "Int" } ],
        "ret-type": { "k": "con", "name": "Int" },
        "effects": [],
        "body": {
          "t": "app",
          "fn": { "t": "var", "name": "+" },
          "args": [
            { "t": "var", "name": "x" },
            { "t": "var", "name": "y" }
          ]
        }
      }
    }
  ]
}
