Skip to content

Commit 8dcd1fe

Browse files
committed
Simplify gencopy arrow_type helper
Signed-off-by: Nathan Rebours <[email protected]>
1 parent f088173 commit 8dcd1fe

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

dev/gencopy/gencopy.ml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,7 @@ module Copy = struct
4949
Printf.sprintf "copy_%s" name
5050

5151
let arrow_type args ret =
52-
let rev_args = List.rev args in
53-
let rec aux acc args =
54-
match args with
55-
| [] -> acc
56-
| hd :: tl ->
57-
let acc = Ast_builder.ptyp_arrow Nolabel hd acc in
58-
aux acc tl
59-
in
60-
aux ret rev_args
52+
List.fold_right (Ast_builder.ptyp_arrow Nolabel) args ret
6153

6254
let arg_type_from_param i =
6355
let arg = from_var i in

0 commit comments

Comments
 (0)