Skip to content

Commit 555cdbd

Browse files
committed
simplify
1 parent 51a305e commit 555cdbd

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

compiler/frontend/ast_core_type.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ let get_curry_arity (ty : t) =
131131

132132
let is_arity_one ty = get_curry_arity ty = 1
133133

134-
let mk_fn_type ~loc (new_arg_types_ty : Parsetree.arg list) (result : t) : t =
135-
Typ.arrows ~loc new_arg_types_ty result
136-
137134
let list_of_arrow (ty : t) : t * Parsetree.arg list =
138135
let rec aux (ty : t) acc =
139136
match ty.ptyp_desc with
@@ -148,6 +145,6 @@ let list_of_arrow (ty : t) : t * Parsetree.arg list =
148145

149146
let add_last_obj (ty : t) (obj : t) =
150147
let result, params = list_of_arrow ty in
151-
mk_fn_type ~loc:obj.ptyp_loc
148+
Typ.arrows ~loc:obj.ptyp_loc
152149
(params @ [{lbl = Nolabel; typ = obj; attrs = []}])
153150
result

compiler/frontend/ast_core_type.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ val get_uncurry_arity : t -> int option
4747
None -- means not a function
4848
*)
4949

50-
val mk_fn_type : loc:Location.t -> Parsetree.arg list -> t -> t
51-
5250
val list_of_arrow : t -> t * Parsetree.arg list
5351
(** fails when Ptyp_poly *)
5452

compiler/frontend/ast_external_process.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
592592
in
593593

594594
( List.length new_arg_types_ty,
595-
Ast_core_type.mk_fn_type ~loc new_arg_types_ty result,
595+
Ast_helper.Typ.arrows ~loc new_arg_types_ty result,
596596
External_ffi_types.ffi_obj_create arg_kinds )
597597
| _ -> Location.raise_errorf ~loc "Attribute found that conflicts with %@obj"
598598

@@ -1005,7 +1005,7 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
10051005
let return_wrapper =
10061006
check_return_wrapper loc external_desc.return_wrapper result_type
10071007
in
1008-
let fn_type = Ast_core_type.mk_fn_type ~loc new_arg_types_ty result_type in
1008+
let fn_type = Ast_helper.Typ.arrows ~loc new_arg_types_ty result_type in
10091009
( build_uncurried_type ~arity:(List.length new_arg_types_ty) fn_type,
10101010
External_ffi_types.ffi_bs arg_type_specs return_wrapper ffi,
10111011
unused_attrs,

0 commit comments

Comments
 (0)