From 2100a0a0fb1b748097cd957a3cf31bf1d683d252 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 24 Oct 2021 22:56:36 -0400 Subject: [PATCH] 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); )