File tree Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Original file line number Diff line number Diff line change 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
85let 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-
2617let of_int x : t = x <> 0
2718
2819type 'a printer = Format .formatter -> 'a -> unit
Original file line number Diff line number Diff line change 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
138val 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-
2516val of_int : int -> t
2617(* * [of_int i] is the same as [i <> 0]
2718 @since 2.7 *)
You can’t perform that action at this time.
0 commit comments