{
  "schema": "ailang/v0",
  "name": "fn_calls_prelude",
  "imports": [],
  "defs": [
    {
      "kind": "fn",
      "name": "add",
      "doc": "Add two Ints via the polymorphic prelude `+`. Also exercises TermLet by binding the sum to a local name before returning it, and TermClone by re-using the let-bound value.",
      "type": {
        "k": "fn",
        "params": [
          { "k": "con", "name": "Int" },
          { "k": "con", "name": "Int" }
        ],
        "param_modes": ["own", "own"],
        "ret": { "k": "con", "name": "Int" },
        "ret_mode": "own",
        "effects": []
      },
      "params": ["x", "y"],
      "body": {
        "t": "let",
        "name": "s",
        "value": {
          "t": "app",
          "fn": { "t": "var", "name": "+" },
          "args": [
            { "t": "var", "name": "x" },
            { "t": "var", "name": "y" }
          ]
        },
        "body": { "t": "clone", "value": { "t": "var", "name": "s" } }
      }
    }
  ]
}
