From 8830f598dff6050e09475ebb1c7f9f97d74bff6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 14 Mar 2019 20:09:06 +0100 Subject: [PATCH] skeleton for a_types --- Typecheck2.ml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Typecheck2.ml b/Typecheck2.ml index 565610542..0c84ebe8f 100644 --- a/Typecheck2.ml +++ b/Typecheck2.ml @@ -108,9 +108,19 @@ type te = O.type_expr list SMap.t type ve = O.type_expr list SMap.t type tve = te * ve -let a_types : tve -> I.type_decl list -> tve * O.type_decl list = +let fold_map f a l = + let f (acc, l) elem = + let acc', elem' = f acc elem + in acc', (elem' :: l) in + let last_acc, last_l = List.fold_left f (a, []) l + in last_acc, List.rev last_l + +let a_type (tve : tve) ({name;ty;orig} : I.type_decl) : tve * O.type_decl = failwith "TODO" +let a_types (tve : tve) (l : I.type_decl list) : tve * O.type_decl list = + fold_map a_type tve l + let a_storage_decl : tve -> I.typed_var -> tve * O.typed_var = failwith "TODO"