@@ -128,7 +128,9 @@ let app1 = Ast_compatible.app1
128
128
129
129
let app2 = Ast_compatible. app2
130
130
131
- let ( ->~ ) a b = Ast_compatible. arrow a b
131
+ let ( ->~ ) a b =
132
+ Ast_uncurried. uncurried_type ~loc: Location. none ~arity: 1
133
+ (Ast_compatible. arrow a b)
132
134
133
135
let raise_when_not_found_ident =
134
136
Longident. Ldot (Lident Primitive_modules. util, " raiseWhenNotFound" )
@@ -167,9 +169,10 @@ let init () =
167
169
in
168
170
let to_js_body body =
169
171
Ast_comb. single_non_rec_value pat_to_js
170
- (Ast_compatible. fun_ ~arity: None
171
- (Pat. constraint_ (Pat. var pat_param) core_type)
172
- body)
172
+ (Ast_uncurried. uncurried_fun ~loc: Location. none ~arity: 1
173
+ (Ast_compatible. fun_ ~arity: None
174
+ (Pat. constraint_ (Pat. var pat_param) core_type)
175
+ body))
173
176
in
174
177
let ( +> ) a ty = Exp. constraint_ (erase_type a) ty in
175
178
let ( +: ) a ty = erase_type (Exp. constraint_ a ty) in
@@ -211,12 +214,16 @@ let init () =
211
214
in
212
215
let from_js =
213
216
Ast_comb. single_non_rec_value pat_from_js
214
- (Ast_compatible. fun_ ~arity: None (Pat. var pat_param)
215
- (if create_type then
216
- Exp. let_ Nonrecursive
217
- [Vb. mk (Pat. var pat_param) (exp_param +: new_type)]
218
- (Exp. constraint_ obj_exp core_type)
219
- else Exp. constraint_ obj_exp core_type))
217
+ (Ast_uncurried. uncurried_fun ~loc: Location. none ~arity: 1
218
+ (Ast_compatible. fun_ ~arity: (Some 1 ) (Pat. var pat_param)
219
+ (if create_type then
220
+ Exp. let_ Nonrecursive
221
+ [
222
+ Vb. mk (Pat. var pat_param)
223
+ (exp_param +: new_type);
224
+ ]
225
+ (Exp. constraint_ obj_exp core_type)
226
+ else Exp. constraint_ obj_exp core_type)))
220
227
in
221
228
let rest = [to_js; from_js] in
222
229
if create_type then erase_type_str :: new_type_str :: rest
@@ -253,12 +260,14 @@ let init () =
253
260
app2 unsafe_index_get_exp exp_map exp_param
254
261
else app1 erase_type_exp exp_param);
255
262
Ast_comb. single_non_rec_value pat_from_js
256
- (Ast_compatible. fun_ ~arity: None (Pat. var pat_param)
257
- (let result =
258
- app2 unsafe_index_get_exp rev_exp_map exp_param
259
- in
260
- if create_type then raise_when_not_found result
261
- else result));
263
+ (Ast_uncurried. uncurried_fun ~loc: Location. none ~arity: 1
264
+ (Ast_compatible. fun_ ~arity: (Some 1 )
265
+ (Pat. var pat_param)
266
+ (let result =
267
+ app2 unsafe_index_get_exp rev_exp_map exp_param
268
+ in
269
+ if create_type then raise_when_not_found result
270
+ else result)));
262
271
]
263
272
in
264
273
if create_type then new_type_str :: v else v
@@ -285,7 +294,8 @@ let init () =
285
294
let pat_from_js = {Asttypes. loc; txt = from_js} in
286
295
let to_js_type result =
287
296
Ast_comb. single_non_rec_val pat_to_js
288
- (Ast_compatible. arrow core_type result)
297
+ (Ast_uncurried. uncurried_type ~loc: Location. none ~arity: 1
298
+ (Ast_compatible. arrow core_type result))
289
299
in
290
300
let new_type, new_tdcl =
291
301
U. new_type_of_type_declaration tdcl (" abs_" ^ name)
0 commit comments