#open "expr";; #open "divers";; #open "types";; type TypeSynt = TSProd of TypeSynt*TypeSynt | TSFleche of TypeSynt*TypeSynt | TSConstr of ID*(TypeSynt list) | TSVar of ID ;; type TypeDef == (ID list)*ID;; type TypeSommeDef == (ID*(TypeSynt option)) list;; type TLPhrase = Expr of Expression | Decl of (bool*((ID*Expression) list)) | TypeDecl of TypeDef*TypeSommeDef ;; let rec pr_typesynt = function TSProd (a,b) -> pr "("; pr_typesynt a; pr "*"; pr_typesynt b; pr ")" | TSFleche (a,b) -> pr "("; pr_typesynt a; pr "->"; pr_typesynt b; pr ")" | TSConstr (c,v) -> pr c; pr "["; do_list_sep pr_typesynt (function ()-> pr ",") v; pr "]" | TSVar v -> pr "'"; pr v ;; (* let table_types = make_table ();; let table_constr = make_table ();; let type_unit = {TSvars=0; TSnbconstr=1;TSconstrs=[|None|]};; let constr_unit = Some (TISomme (type_unit, []));; type_unit.TSconstrs.(0)<-constr_unit;; let type_ref = {TSvars=1; TSnbconstr=1;TSconstrs=[|None|]};; let constr_ref = Some (TIVar 0);; type_ref.TSconstrs.(0)<-constr_ref;; table_types.add "unit" type_unit;; table_constr.add "()" constr_unit;; table_types.add "ref" type_ref;; table_constr.add "ref" constr_ref;; *)