diff --git a/src/core/CCArrayLabels.mli b/src/core/CCArrayLabels.mli index 6e32b32e..c914de21 100644 --- a/src/core/CCArrayLabels.mli +++ b/src/core/CCArrayLabels.mli @@ -16,10 +16,7 @@ type 'a printer = Format.formatter -> 'a -> unit external make_float : int -> float array = "caml_make_float_vect" (* compat *) (**/**) -include module type of ArrayLabels - -type 'a t = 'a array -(** The type for arrays *) +include module type of CCShimsArrayLabels_ val empty : 'a t (** [empty] is the empty array, physically equal to [||]. *) diff --git a/src/core/dune b/src/core/dune index c0de73dc..e4055b68 100644 --- a/src/core/dune +++ b/src/core/dune @@ -6,7 +6,7 @@ (rule (targets CCShims_.ml CCShimsList_.ml CCShimsFun_.ml CCShimsFun_.mli - CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml) + CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml CCShimsArrayLabels_.ml) (deps ./mkshims.exe) (action (run ./mkshims.exe))) diff --git a/src/core/mkshims.ml b/src/core/mkshims.ml index 33afafa1..e4618bc9 100644 --- a/src/core/mkshims.ml +++ b/src/core/mkshims.ml @@ -76,7 +76,18 @@ let shims_list_post_408 = "include List" let shims_array_pre_406 = " include Array - module Floatarray = struct end + module Floatarray = struct type t = float array end + type 'a t = 'a array + " + +let shims_array_label_pre_406 = " + include ArrayLabels + module Floatarray = struct type t = float array end + type 'a t = 'a array + " + +let shims_array_label_406_408 = " + include ArrayLabels type 'a t = 'a array " @@ -85,6 +96,7 @@ let shims_array_406_408 = " type 'a t = 'a array " let shims_array_post_408 = "include Array" +let shims_array_label_post_408 = "include ArrayLabels" let shims_let_op_pre_408 = " @@ -148,6 +160,10 @@ let () = (if (major, minor) >= (4,8) then shims_array_post_408 else if (major, minor) >= (4,6) then shims_array_406_408 else shims_array_pre_406); + write_file "CCShimsArrayLabels_.ml" + (if (major, minor) >= (4,8) then shims_array_label_post_408 + else if (major, minor) >= (4,6) then shims_array_label_406_408 + else shims_array_label_pre_406); write_file "CCShimsFormat_.ml" (if (major, minor) >= (4,8) then shims_fmt_post_408 else shims_fmt_pre_408); write_file "CCShimsFun_.ml" (if (major, minor) >= (4,8) then shims_fun_post_408 else shims_fun_pre_408); write_file "CCShimsFun_.mli" (if (major, minor) >= (4,8) then shims_fun_mli_post_408 else shims_fun_mli_pre_408);