diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2009-05-20 11:52:42 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2009-05-20 11:52:42 +0000 |
commit | ed32f569e3b636e0f12efdbbd5bba9e05cc434ac (patch) | |
tree | 20b551901a72edf7733a6fe5287deab21ed9b83b /typing/subst.ml | |
parent | 7795eafa896b0c5b3066d5efec7ec49d69d44e4d (diff) |
merge changes from ocaml3110 to ocaml3111rc0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9270 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/subst.ml')
-rw-r--r-- | typing/subst.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/typing/subst.ml b/typing/subst.ml index 6b1282697..833b3634a 100644 --- a/typing/subst.ml +++ b/typing/subst.ml @@ -294,3 +294,12 @@ and signature_component s comp newid = and modtype_declaration s = function Tmodtype_abstract -> Tmodtype_abstract | Tmodtype_manifest mty -> Tmodtype_manifest(modtype s mty) + +(* Composition of substitutions: + apply (compose s1 s2) x = apply s2 (apply s1 x) *) + +let compose s1 s2 = + { types = Tbl.map (fun id p -> type_path s2 p) s1.types; + modules = Tbl.map (fun id p -> module_path s2 p) s1.modules; + modtypes = Tbl.map (fun id mty -> modtype s2 mty) s1.modtypes; + for_saving = false } |