feat(CCChar): add CCChar.Infix

This commit is contained in:
Fardale 2021-03-12 18:27:09 +01:00
parent 4ad331fbe3
commit 2c96dd1b55
2 changed files with 37 additions and 1 deletions

View file

@ -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

View file

@ -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