Module CCBool

Basic Bool functions

type t = bool =
  1. | false
  2. | true
val not : bool -> bool
val (&&) : bool -> bool -> bool
val (||) : bool -> bool -> bool
val equal : bool -> bool -> bool
val compare : bool -> bool -> int
val to_int : bool -> int
val to_float : bool -> float
val to_string : bool -> string
val seeded_hash : int -> bool -> int
val hash : bool -> int
val if_then : (unit -> 'a) -> t -> 'a option

if_then f x is Some (f ()) if x is true and None otherwise.

  • since 3.13
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 of_int : int -> t

of_int i is the same as i <> 0

  • since 2.7
type 'a printer = Format.formatter -> 'a -> unit
val pp : t printer