We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Typ.arrows
1 parent dffc266 commit 51a305eCopy full SHA for 51a305e
compiler/frontend/ast_core_type.ml
@@ -132,15 +132,7 @@ let get_curry_arity (ty : t) =
132
let is_arity_one ty = get_curry_arity ty = 1
133
134
let mk_fn_type ~loc (new_arg_types_ty : Parsetree.arg list) (result : t) : t =
135
- let t =
136
- Ext_list.fold_right new_arg_types_ty result (fun {lbl; typ; attrs} acc ->
137
- Ast_helper.Typ.arrow ~loc ~attrs ~arity:None {attrs = []; lbl; typ} acc)
138
- in
139
- match t.ptyp_desc with
140
- | Ptyp_arrow arr ->
141
- let arity = List.length new_arg_types_ty in
142
- {t with ptyp_desc = Ptyp_arrow {arr with arity = Some arity}}
143
- | _ -> t
+ Typ.arrows ~loc new_arg_types_ty result
144
145
let list_of_arrow (ty : t) : t * Parsetree.arg list =
146
let rec aux (ty : t) acc =
0 commit comments