1Stdlib.Bool(3) OCaml library Stdlib.Bool(3)
2
3
4
6 Stdlib.Bool - no description
7
9 Module Stdlib.Bool
10
12 Module Bool
13 : (module Stdlib__bool)
14
15
16
17
18
19
20
21
22
23 Booleans
24 type t = bool =
25 | false
26 | true
27
28
29 The type of booleans (truth values).
30
31 The constructors false and true are included here so that they have
32 paths, but they are not intended to be used in user-defined data types.
33
34
35
36 val not : bool -> bool
37
38
39 not b is the boolean negation of b .
40
41
42
43 val (&&) : bool -> bool -> bool
44
45
46 e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If
47 e0 evaluates to false , e1 is not evaluated. Right-associative operator
48 at precedence level 3/11.
49
50
51
52 val (||) : bool -> bool -> bool
53
54
55 e0 || e1 is the lazy boolean disjunction of expressions e0 and e1 . If
56 e0 evaluates to true , e1 is not evaluated. Right-associative operator
57 at precedence level 2/11.
58
59
60
61
62 Predicates and comparisons
63 val equal : bool -> bool -> bool
64
65
66 equal b0 b1 is true iff b0 and b1 are both either true or false .
67
68
69
70 val compare : bool -> bool -> int
71
72
73 compare b0 b1 is a total order on boolean values. false is smaller
74 than true .
75
76
77
78
79 Converting
80 val to_int : bool -> int
81
82
83 to_int b is 0 if b is false and 1 if b is true .
84
85
86
87 val to_float : bool -> float
88
89
90 to_float b is 0. if b is false and 1. if b is true .
91
92
93
94 val to_string : bool -> string
95
96
97 to_string b is true if b is true and false if b is false .
98
99
100
101
102
103OCamldoc 2019-07-30 Stdlib.Bool(3)