Skip to content

Commit

Permalink
Simplify type variable reconstruction
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Ferris <[email protected]>

Co-authored-by: Nathan Rebours <[email protected]>
  • Loading branch information
patricoferris and NathanReb committed Nov 30, 2024
1 parent 8c3bcea commit cb22c1c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gen/gen_ast_builder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ struct
| [] -> M.ctyp "%s" typ_name
| params ->
let params =
List.fold_left params ~init:"" ~f:(fun acc (ctyp, _) ->
Format.asprintf "%a" A.ctyp ctyp ^ ", " ^ acc)
List.map params ~f:(fun (ctyp, _) -> Format.asprintf "%a" A.ctyp ctyp)
in
let params = String.sub params ~pos:0 ~len:(String.length params - 2) in
M.ctyp "(%s) %s" params typ_name
M.ctyp "(%s) %s" (String.concat ~sep:", " params) typ_name

let gen_combinator_for_constructor
~wrapper:(wpath, wprefix, has_attrs, has_loc_stack) path ~prefix
Expand Down

0 comments on commit cb22c1c

Please sign in to comment.