Skip to content

Instantly share code, notes, and snippets.

@omochi
Last active August 29, 2015 14:26
Show Gist options
  • Save omochi/9a02fc97eb8e8775025f to your computer and use it in GitHub Desktop.
Save omochi/9a02fc97eb8e8775025f to your computer and use it in GitHub Desktop.
{
// <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