mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
CCBool(cleanup): remove function always present on 4.08
This commit is contained in:
parent
1fd377e5c1
commit
da45e33501
2 changed files with 3 additions and 21 deletions
|
|
@ -1,9 +1,6 @@
|
|||
(* This file is free software, part of containers. See file "license" for more details. *)
|
||||
|
||||
type t = bool
|
||||
|
||||
let equal (a : bool) b = Stdlib.( = ) a b
|
||||
let compare (a : bool) b = Stdlib.compare a b
|
||||
include Bool
|
||||
|
||||
let if_then f x =
|
||||
if x then
|
||||
|
|
@ -17,12 +14,6 @@ let if_then_else f g x =
|
|||
else
|
||||
g ()
|
||||
|
||||
let to_int (x : bool) : int =
|
||||
if x then
|
||||
1
|
||||
else
|
||||
0
|
||||
|
||||
let of_int x : t = x <> 0
|
||||
|
||||
type 'a printer = Format.formatter -> 'a -> unit
|
||||
|
|
|
|||
|
|
@ -2,13 +2,8 @@
|
|||
|
||||
(** Basic Bool functions *)
|
||||
|
||||
type t = bool
|
||||
|
||||
val compare : t -> t -> int
|
||||
(** [compare b1 b2] is the total ordering on booleans [b1] and [b2], similar to {!Stdlib.compare}. *)
|
||||
|
||||
val equal : t -> t -> bool
|
||||
(** [equal b1 b2] is [true] if [b1] and [b2] are the same. *)
|
||||
include module type of Bool
|
||||
(** @inline *)
|
||||
|
||||
val if_then : (unit -> 'a) -> t -> 'a option
|
||||
(** [if_then f x] is [Some (f ())] if [x] is true and None otherwise.
|
||||
|
|
@ -18,10 +13,6 @@ val if_then_else : (unit -> 'a) -> (unit -> 'a) -> t -> 'a
|
|||
(** [if_then_else f g x] is [f ()] if [x] is true and [g ()] otherwise.
|
||||
@since 3.13 *)
|
||||
|
||||
val to_int : t -> int
|
||||
(** [to_int true = 1], [to_int false = 0].
|
||||
@since 2.7 *)
|
||||
|
||||
val of_int : int -> t
|
||||
(** [of_int i] is the same as [i <> 0]
|
||||
@since 2.7 *)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue