@@ -40,6 +40,7 @@ and ident_array = ident_create "array"
40
40
and ident_list = ident_create " list"
41
41
and ident_option = ident_create " option"
42
42
and ident_result = ident_create " result"
43
+ and ident_dict = ident_create " dict"
43
44
44
45
and ident_int64 = ident_create " int64"
45
46
and ident_lazy_t = ident_create " lazy_t"
@@ -82,6 +83,7 @@ and path_array = Pident ident_array
82
83
and path_list = Pident ident_list
83
84
and path_option = Pident ident_option
84
85
and path_result = Pident ident_result
86
+ and path_dict = Pident ident_dict
85
87
86
88
87
89
and path_int64 = Pident ident_int64
@@ -105,6 +107,7 @@ and type_array t = newgenty (Tconstr(path_array, [t], ref Mnil))
105
107
and type_list t = newgenty (Tconstr (path_list, [t], ref Mnil ))
106
108
and type_option t = newgenty (Tconstr (path_option, [t], ref Mnil ))
107
109
and type_result t1 t2 = newgenty (Tconstr (path_result, [t1; t2], ref Mnil ))
110
+ and type_dict t = newgenty (Tconstr (path_dict, [t], ref Mnil ))
108
111
109
112
and type_int64 = newgenty (Tconstr (path_int64, [] , ref Mnil ))
110
113
and 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 =
226
229
Type_variant ([cstr ident_ok [tvar1];
227
230
cstr ident_error [tvar2]]);
228
231
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]}
229
238
and decl_uncurried =
230
239
let tvar1, tvar2 = newgenvar() , newgenvar() in
231
240
{decl_abstr with
@@ -292,6 +301,7 @@ let common_initial_env add_type add_extension empty_env =
292
301
add_type ident_lazy_t decl_lazy_t (
293
302
add_type ident_option decl_option (
294
303
add_type ident_result decl_result (
304
+ add_type ident_dict decl_dict (
295
305
add_type ident_list decl_list (
296
306
add_type ident_array decl_array (
297
307
add_type ident_exn decl_exn (
@@ -305,7 +315,7 @@ let common_initial_env add_type add_extension empty_env =
305
315
add_type ident_extension_constructor decl_abstr (
306
316
add_type ident_floatarray decl_abstr (
307
317
add_type ident_promise decl_promise (
308
- empty_env))))))))))))))))))))))))))
318
+ empty_env)))))))))))))))))))))))))))
309
319
310
320
let build_initial_env add_type add_exception empty_env =
311
321
let common = common_initial_env add_type add_exception empty_env in
0 commit comments