You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
367 B

type primitive_type = Unit | Bool
type type_variable = string
type dddddml_type =
| Variable of type_variable
| Primitive of primitive_type
| Arrow of dddddml_type * dddddml_type
let rec subst t t' e =
if e = t then t'
else
match e with
| Variable _ | Primitive _ ->
e
| Arrow (t1, t2) ->
Arrow (subst t t' t1, subst t t' t2)