diff --git a/src/core/CCChar.ml b/src/core/CCChar.ml index 48a852ca..7ea5a236 100644 --- a/src/core/CCChar.ml +++ b/src/core/CCChar.ml @@ -21,5 +21,15 @@ let to_int = Char.code let to_string c = String.make 1 c (*$Q to_string - (Q.string_of_size (Q.Gen.return 1)) (fun s -> to_string s.[0] = s) + (Q.string_of_size (Q.Gen.return 1)) (fun s -> Stdlib.(=) (to_string s.[0]) s) *) + +module Infix = struct + let (=) : t -> t -> bool = Stdlib.(=) + let (<>) : t -> t -> bool = Stdlib.(<>) + let (<) : t -> t -> bool = Stdlib.(<) + let (>) : t -> t -> bool = Stdlib.(>) + let (<=) : t -> t -> bool = Stdlib.(<=) + let (>=) : t -> t -> bool = Stdlib.(>=) +end +include Infix diff --git a/src/core/CCChar.mli b/src/core/CCChar.mli index dbd3a351..f0c626c3 100644 --- a/src/core/CCChar.mli +++ b/src/core/CCChar.mli @@ -37,3 +37,29 @@ val pp_buf : Buffer.t -> t -> unit val pp : Format.formatter -> t -> unit (** Renamed from [print] since 2.0. *) + +(** {2 Infix Operators} + + @since NEXT_RELEASE *) + +module Infix : sig + val (=) : t -> t -> bool + (** @since NEXT_RELEASE *) + + val (<>) : t -> t -> bool + (** @since NEXT_RELEASE *) + + val (<) : t -> t -> bool + (** @since NEXT_RELEASE *) + + val (>) : t -> t -> bool + (** @since NEXT_RELEASE *) + + val (<=) : t -> t -> bool + (** @since NEXT_RELEASE *) + + val (>=) : t -> t -> bool + (** @since NEXT_RELEASE *) +end + +include module type of Infix