Skip to content

Commit da45e33

Browse files
committed
CCBool(cleanup): remove function always present on 4.08
1 parent 1fd377e commit da45e33

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/core/CCBool.ml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
(* This file is free software, part of containers. See file "license" for more details. *)
22

3-
type t = bool
4-
5-
let equal (a : bool) b = Stdlib.( = ) a b
6-
let compare (a : bool) b = Stdlib.compare a b
3+
include Bool
74

85
let if_then f x =
96
if x then
@@ -17,12 +14,6 @@ let if_then_else f g x =
1714
else
1815
g ()
1916

20-
let to_int (x : bool) : int =
21-
if x then
22-
1
23-
else
24-
0
25-
2617
let of_int x : t = x <> 0
2718

2819
type 'a printer = Format.formatter -> 'a -> unit

src/core/CCBool.mli

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
(** Basic Bool functions *)
44

5-
type t = bool
6-
7-
val compare : t -> t -> int
8-
(** [compare b1 b2] is the total ordering on booleans [b1] and [b2], similar to {!Stdlib.compare}. *)
9-
10-
val equal : t -> t -> bool
11-
(** [equal b1 b2] is [true] if [b1] and [b2] are the same. *)
5+
include module type of Bool
6+
(** @inline *)
127

138
val if_then : (unit -> 'a) -> t -> 'a option
149
(** [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
1813
(** [if_then_else f g x] is [f ()] if [x] is true and [g ()] otherwise.
1914
@since 3.13 *)
2015

21-
val to_int : t -> int
22-
(** [to_int true = 1], [to_int false = 0].
23-
@since 2.7 *)
24-
2516
val of_int : int -> t
2617
(** [of_int i] is the same as [i <> 0]
2718
@since 2.7 *)

0 commit comments

Comments
 (0)