diff --git a/src/core/CCEither.ml b/src/core/CCEither.ml index 30a64f6f..10832602 100644 --- a/src/core/CCEither.ml +++ b/src/core/CCEither.ml @@ -5,6 +5,12 @@ type 'a equal = 'a -> 'a -> bool type 'a ord = 'a -> 'a -> int type 'a printer = Format.formatter -> 'a -> unit +[@@@ifge 4.12] + +include Either + +[@@@else_] + (** {2 Basics} *) type ('a, 'b) t = ('a, 'b) Either.t = @@ -62,6 +68,8 @@ let compare ~left ~right e1 e2 = | Left l1, Left l2 -> left l1 l2 | Right r1, Right r2 -> right r1 r2 +[@@@endif] + (** {2 IO} *) let pp ~left ~right fmt = function diff --git a/src/core/CCEither.mli b/src/core/CCEither.mli index ce6f4e18..31817b29 100644 --- a/src/core/CCEither.mli +++ b/src/core/CCEither.mli @@ -13,6 +13,13 @@ type 'a equal = 'a -> 'a -> bool type 'a ord = 'a -> 'a -> int type 'a printer = Format.formatter -> 'a -> unit +[@@@ifge 4.12] + +include module type of Either +(** @inline *) + +[@@@else_] + (** {2 Basics} *) type ('a, 'b) t = ('a, 'b) Either.t = @@ -70,6 +77,8 @@ val compare : ('a, 'b) t -> int +[@@@endif] + (** {2 IO} *) val pp : left:'a printer -> right:'b printer -> ('a, 'b) t printer