add monomorphic signatures in CCInt and CCFloat

This commit is contained in:
Simon Cruanes 2016-04-22 22:07:06 +02:00
parent d3b6f6020f
commit b17f55b1d1
4 changed files with 78 additions and 0 deletions

View file

@ -74,3 +74,13 @@ let random_range i j st = i +. random (j-.i) st
let equal_precision ~epsilon a b = abs_float (a-.b) < epsilon let equal_precision ~epsilon a b = abs_float (a-.b) < epsilon
let classify = Pervasives.classify_float let classify = Pervasives.classify_float
module Infix = struct
let (=) = Pervasives.(=)
let (<>) = Pervasives.(<>)
let (<) = Pervasives.(<)
let (>) = Pervasives.(>)
let (<=) = Pervasives.(<=)
let (>=) = Pervasives.(>=)
end
include Infix

View file

@ -76,3 +76,28 @@ val equal_precision : epsilon:t -> t -> t -> bool
(** Equality with allowed error up to a non negative epsilon value *) (** Equality with allowed error up to a non negative epsilon value *)
val classify : float -> fpclass val classify : float -> fpclass
(** {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

View file

@ -53,3 +53,15 @@ let to_string = string_of_int
let of_string s = let of_string s =
try Some (int_of_string s) try Some (int_of_string s)
with _ -> None with _ -> None
module Infix = struct
let (=) = Pervasives.(=)
let (<>) = Pervasives.(<>)
let (<) = Pervasives.(<)
let (>) = Pervasives.(>)
let (<=) = Pervasives.(<=)
let (>=) = Pervasives.(>=)
end
include Infix
let min = min
let max = max

View file

@ -39,3 +39,34 @@ val to_string : t -> string
val of_string : string -> t option val of_string : string -> t option
(** @since 0.13 *) (** @since 0.13 *)
val min : t -> t -> t
(** @since NEXT_RELEASE *)
val max : t -> t -> t
(** @since NEXT_RELEASE *)
(** {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