@@ -40,6 +40,7 @@ and ident_array = ident_create "array"
4040and ident_list = ident_create " list"
4141and ident_option = ident_create " option"
4242and ident_result = ident_create " result"
43+ and ident_dict = ident_create " dict"
4344
4445and ident_int64 = ident_create " int64"
4546and ident_lazy_t = ident_create " lazy_t"
@@ -82,6 +83,7 @@ and path_array = Pident ident_array
8283and path_list = Pident ident_list
8384and path_option = Pident ident_option
8485and path_result = Pident ident_result
86+ and path_dict = Pident ident_dict
8587
8688
8789and path_int64 = Pident ident_int64
@@ -105,6 +107,7 @@ and type_array t = newgenty (Tconstr(path_array, [t], ref Mnil))
105107and type_list t = newgenty (Tconstr (path_list, [t], ref Mnil ))
106108and type_option t = newgenty (Tconstr (path_option, [t], ref Mnil ))
107109and type_result t1 t2 = newgenty (Tconstr (path_result, [t1; t2], ref Mnil ))
110+ and type_dict t = newgenty (Tconstr (path_dict, [t], ref Mnil ))
108111
109112and type_int64 = newgenty (Tconstr (path_int64, [] , ref Mnil ))
110113and type_lazy_t t = newgenty (Tconstr (path_lazy_t, [t], ref Mnil ))
@@ -226,6 +229,12 @@ let common_initial_env add_type add_extension empty_env =
226229 Type_variant ([cstr ident_ok [tvar1];
227230 cstr ident_error [tvar2]]);
228231 type_variance = [Variance. covariant; Variance. covariant]}
232+ and decl_dict =
233+ let tvar = newgenvar() in
234+ {decl_abstr with
235+ type_params = [tvar];
236+ type_arity = 1 ;
237+ type_variance = [Variance. covariant]}
229238 and decl_uncurried =
230239 let tvar1, tvar2 = newgenvar() , newgenvar() in
231240 {decl_abstr with
@@ -292,6 +301,7 @@ let common_initial_env add_type add_extension empty_env =
292301 add_type ident_lazy_t decl_lazy_t (
293302 add_type ident_option decl_option (
294303 add_type ident_result decl_result (
304+ add_type ident_dict decl_dict (
295305 add_type ident_list decl_list (
296306 add_type ident_array decl_array (
297307 add_type ident_exn decl_exn (
@@ -305,7 +315,7 @@ let common_initial_env add_type add_extension empty_env =
305315 add_type ident_extension_constructor decl_abstr (
306316 add_type ident_floatarray decl_abstr (
307317 add_type ident_promise decl_promise (
308- empty_env))))))))))))))))))))))))))
318+ empty_env)))))))))))))))))))))))))))
309319
310320let build_initial_env add_type add_exception empty_env =
311321 let common = common_initial_env add_type add_exception empty_env in
0 commit comments