Files
AILang/examples/test_22b3_mono_synthetic.ail.json
T

51 lines
1.2 KiB
JSON

{
"schema": "ailang/v0",
"name": "test_22b3_mono_synthetic",
"imports": [],
"defs": [
{
"kind": "class", "name": "Foo", "param": "a",
"methods": [{
"name": "foo",
"type": {
"k": "fn", "params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Int" }, "effects": []
}
}]
},
{
"kind": "instance",
"class": "Foo",
"type": { "k": "con", "name": "Int" },
"methods": [{
"name": "foo",
"body": {
"t": "lam",
"params": ["i"],
"paramTypes": [{ "k": "var", "name": "a" }],
"retType": { "k": "con", "name": "Int" },
"body": { "t": "var", "name": "i" }
}
}]
},
{
"kind": "fn",
"name": "main",
"type": {
"k": "fn", "params": [], "ret": { "k": "con", "name": "Unit" },
"effects": ["IO"]
},
"params": [],
"body": {
"t": "do",
"op": "io/print_int",
"args": [{
"t": "app",
"fn": { "t": "var", "name": "foo" },
"args": [{ "t": "lit", "lit": { "kind": "int", "value": 5 } }]
}]
}
}
]
}