{ "schema": "ailang/v0", "name": "show_user_adt", "imports": [], "defs": [ { "kind": "type", "name": "IntBox", "vars": [], "ctors": [ { "name": "MkIntBox", "fields": [{ "k": "con", "name": "Int" }] } ] }, { "kind": "instance", "class": "prelude.Show", "type": { "k": "con", "name": "IntBox" }, "methods": [ { "name": "show", "body": { "t": "lam", "params": ["x"], "paramTypes": [{ "k": "con", "name": "IntBox" }], "retType": { "k": "con", "name": "Str" }, "body": { "t": "match", "scrutinee": { "t": "var", "name": "x" }, "arms": [ { "pat": { "p": "ctor", "ctor": "MkIntBox", "fields": [{ "p": "var", "name": "n" }] }, "body": { "t": "app", "fn": { "t": "var", "name": "int_to_str" }, "args": [{ "t": "var", "name": "n" }] } } ] } } } ] }, { "kind": "fn", "name": "main", "type": { "k": "fn", "params": [], "ret": { "k": "con", "name": "Unit" }, "effects": ["IO"] }, "params": [], "body": { "t": "app", "fn": { "t": "var", "name": "print" }, "args": [ { "t": "ctor", "type": "IntBox", "ctor": "MkIntBox", "args": [{ "t": "lit", "lit": { "kind": "int", "value": 7 } }] } ] } } ] }