Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
// <T> Box
"Box": {
"type": "Let",
"params": ["value"],
"body": {
"type": "Class",
"fields": {
"value": "value"
}
}
},
// <T, U> Pair
"Pair": {
"type": "Let",
"params": ["value0", "value1"],
"body": {
"type": "Class",
"fields": {
"value0": "value0",
"value1": "value1"
}
}
},
// Box<Int>
"IntBox": {
"type": "Apply",
"target": {
"type": "Ref",
"name": "Box"
},
"params": {
"value": "Int"
}
},
// Box<String>; Stringを陽に記述
"StringBox": {
"type": "Apply",
"target": {
"type": "Ref",
"name": "Box"
},
"params": {
"value": {
"type": "Ref",
"name": "String"
}
}
},
// <T> class { box: Box<T> }
"BoxBox": {
"type": "Let",
"params": ["value"],
"body": {
"type": "Class",
"fields": {
"box": {
"type": "Apply",
"target": {
"type": "Ref",
"name": "Box"
},
"params": {
"value": "value"
}
}
}
}
},
// <T> Box<T>
"RefBox": {
"type": "Let",
"params": ["value"],
"body": {
"type": "Apply",
"target": {
"type": "Ref",
"name": "Box"
},
"params": {
"value": "value"
}
},
"Hoge": {
"type": "Let",
"params": ["aaa"],
"body": {
"type": "Apply",
"target": {
"type": "Class",
"fields": {
"aaa": "aaa"
}
},
"params": {
"aaa": "Int"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.