From 62ee8ad17e433ed66eb5c4057ed16f673017a28f Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 24 Oct 2021 22:56:36 -0400 Subject: [PATCH 1/3] fix: rely on `either` compatibility library --- src/core/CCEither.ml | 2 +- src/core/CCEither.mli | 3 +-- src/core/dune | 4 ++-- src/core/mkshims.ml | 11 ----------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/core/CCEither.ml b/src/core/CCEither.ml index 6fd3b7e0..3f1d7849 100644 --- a/src/core/CCEither.ml +++ b/src/core/CCEither.ml @@ -7,7 +7,7 @@ type 'a printer = Format.formatter -> 'a -> unit (** {2 Basics} *) -include CCShimsEither_ +type ('a, 'b) t = ('a, 'b) Either.t = Left of 'a | Right of 'b let left l = Left l diff --git a/src/core/CCEither.mli b/src/core/CCEither.mli index c9afb198..bde3dc8d 100644 --- a/src/core/CCEither.mli +++ b/src/core/CCEither.mli @@ -15,8 +15,7 @@ type 'a printer = Format.formatter -> 'a -> unit (** {2 Basics} *) - -include module type of CCShimsEither_ +type ('a, 'b) t = ('a, 'b) Either.t = Left of 'a | Right of 'b val left : 'a -> ('a, 'b) t (** [left l] is [Left l] *) diff --git a/src/core/dune b/src/core/dune index 61f04717..500d2cbd 100644 --- a/src/core/dune +++ b/src/core/dune @@ -7,7 +7,7 @@ (rule (targets CCShims_.ml CCShimsList_.ml CCShimsFun_.ml CCShimsFun_.mli CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml CCShimsMkLetList_.ml - CCShimsArrayLabels_.ml CCShimsInt_.ml CCShimsEither_.ml) + CCShimsArrayLabels_.ml CCShimsInt_.ml) (deps ./mkshims.exe) (action (run ./mkshims.exe))) @@ -20,6 +20,6 @@ (flags :standard -warn-error -a+8 -w -32-67 -safe-string -nolabels -open CCMonomorphic) (ocamlopt_flags (:include ../flambda.flags)) - (libraries seq containers.monomorphic)) + (libraries seq either containers.monomorphic)) (ocamllex (modules CCSexp_lex)) diff --git a/src/core/mkshims.ml b/src/core/mkshims.ml index 134e7204..8e779a23 100644 --- a/src/core/mkshims.ml +++ b/src/core/mkshims.ml @@ -204,14 +204,6 @@ let shims_int_post_408 = " (** {{: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Int.html} Documentation for the standard Int module}*) " -let shims_either_pre_412 = " - type ('a, 'b) t = Left of 'a | Right of 'b - " - -let shims_either_post_412 = " - type ('a, 'b) t = ('a, 'b) Either.t = Left of 'a | Right of 'b -" - let () = C.main ~name:"mkshims" (fun c -> let version = C.ocaml_config_var_exn c "version" in @@ -233,7 +225,4 @@ let () = write_file "CCShimsMkLetList_.ml" (if (major, minor) >= (4,8) then shims_let_op_list_post_408 else shims_let_op_list_pre_408); write_file "CCShimsInt_.ml" (if (major, minor) >= (4,8) then shims_int_post_408 else shims_int_pre_408); - write_file "CCShimsEither_.ml" - (if (major, minor) >= (4,12) then shims_either_post_412 - else shims_either_pre_412); ) From d59a856787adb06d60f32ab8aea49da7446be29f Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 24 Oct 2021 22:57:54 -0400 Subject: [PATCH 2/3] prepare for 3.6.1 --- CHANGELOG.md | 4 ++++ containers-data.opam | 2 +- containers-thread.opam | 2 +- containers.opam | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 687660eb..3d6d6531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.6.1 + +- use `either` compatibility library instead of shims + ## 3.6 - rename `CCOpt` to `CCOption` and deprecate `CCOpt` diff --git a/containers-data.opam b/containers-data.opam index 7eab3a45..202f4899 100644 --- a/containers-data.opam +++ b/containers-data.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.6" +version: "3.6.1" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" synopsis: "A set of advanced datatypes for containers" diff --git a/containers-thread.opam b/containers-thread.opam index d13c5751..d4c32535 100644 --- a/containers-thread.opam +++ b/containers-thread.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.6" +version: "3.6.1" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" diff --git a/containers.opam b/containers.opam index 14dc7f52..582aee88 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "containers" -version: "3.6" +version: "3.6.1" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" From 04693f4f08c8aae7b01066f6e939487be6bc92ed Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 25 Oct 2021 09:35:57 -0400 Subject: [PATCH 3/3] fix opam file --- containers.opam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/containers.opam b/containers.opam index 582aee88..4330b193 100644 --- a/containers.opam +++ b/containers.opam @@ -14,7 +14,8 @@ depends: [ "ocaml" { >= "4.03.0" } "dune" { >= "1.4" } "dune-configurator" - "seq" + "seq" # compat + "either" # compat "qtest" { with-test } "qcheck" { with-test } "ounit" { with-test }