Skip to content

Commit bd69245

Browse files
committed
dce subst
1 parent 907ec8d commit bd69245

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

compiler/ml/subst.ml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -389,26 +389,3 @@ and modtype_declaration s decl =
389389

390390
(* For every binding k |-> d of m1, add k |-> f d to m2
391391
and return resulting merged map. *)
392-
393-
let merge_tbls f m1 m2 = Tbl.fold (fun k d accu -> Tbl.add k (f d) accu) m1 m2
394-
395-
let merge_path_maps f m1 m2 =
396-
PathMap.fold (fun k d accu -> PathMap.add k (f d) accu) m1 m2
397-
398-
let type_replacement s = function
399-
| Path p -> Path (type_path s p)
400-
| Type_function {params; body} ->
401-
let params = List.map (typexp s) params in
402-
let body = typexp s body in
403-
Type_function {params; body}
404-
405-
(* Composition of substitutions:
406-
apply (compose s1 s2) x = apply s2 (apply s1 x) *)
407-
408-
let compose s1 s2 =
409-
{
410-
types = merge_path_maps (type_replacement s2) s1.types s2.types;
411-
modules = merge_path_maps (module_path s2) s1.modules s2.modules;
412-
modtypes = merge_tbls (modtype s2) s1.modtypes s2.modtypes;
413-
for_saving = s1.for_saving || s2.for_saving;
414-
}

compiler/ml/subst.mli

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ val modtype_declaration : t -> modtype_declaration -> modtype_declaration
5757
val module_declaration : t -> module_declaration -> module_declaration
5858
val typexp : t -> Types.type_expr -> Types.type_expr
5959

60-
(* Composition of substitutions:
61-
apply (compose s1 s2) x = apply s2 (apply s1 x) *)
62-
val compose : t -> t -> t
63-
6460
(* A forward reference to be filled in ctype.ml. *)
6561
val ctype_apply_env_empty :
6662
(type_expr list -> type_expr -> type_expr list -> type_expr) ref

0 commit comments

Comments
 (0)