Extend the syntax of types with:
p ::= ... | x : type (Pat TyVar) | x : serializable type (Pat Serial TyVar)
Extend the syntax of values with:
T ::= ... | x (Type TyVar)
v ::= ... | T (Val Type)
Add the type judgements:
(Con TyVar) [x not in ]
(x : type) : context
(Con TyVar) [x not in ]
(x : serializable type) : context
(Serializable TyVar) [x not in ]
(x : type) : serializable context
(Serializable TyVar) [x not in ]
(x : serializable type) : serializable context
Add new rules for pattern matching:
(Type TyVar) , x : type,
x: type
(Type Serial TyVar) , x : serializable type,
x: type
(Serializable TyVar) , x : serializable type,
x: serializable type
Add new binding rules for patterns:
T : type (Match TyVar) T matches x : type
T : serializable type (Match Serial TyVar) T matches x : serializable type
Add a new side-condition to the rule (Exp Dec:
(Pat Bind TyVar) [x not in ]
(x : type) : (x : type)
(Pat Bind Serial TyVar) [x not in ]
(x : serializable type) : (x : serializable type)
Replace the type rule for function application by:
D : ,
e : T (Exp Declaration) [bv disjoint fv T]
D e : T
v : function p : U w matches p (Exp Apply function) v w : U[w/p]