sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Functions for working with boolean values.
Booleans in OCaml / Reason are represented by the true
and false
literals.
Whilst a bool isnt a variant, you will get warnings if you haven't exhaustively pattern match on them:
let bool = false
let string =
match bool with
| false -> "false"
(*
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
true
*)
Functions for working with boolean (true
or false
) values.
The lazy logical AND operator.
Returns true
if both of its operands evaluate to true
.
If the 'left' operand evaluates to false
, the 'right' operand is not evaluated.
Examples
Bool.(true && true) = true
Bool.(true && false) = false
Bool.(false && true) = false
Bool.(false && false) = false
The lazy logical OR operator.
Returns true
if one of its operands evaluates to true
.
If the 'left' operand evaluates to true
, the 'right' operand is not evaluated.
Examples
Bool.(true || true) = true
Bool.(true || false) = true
Bool.(false || true) = true
Bool.(false || false) = false
The exclusive or operator.
Returns true
if exactly one of its operands is true
.
Examples
Bool.xor true true = false
Bool.xor true false = true
Bool.xor false true = true
Bool.xor false false = false
val not : t -> bool
Negate a bool
.
Examples
Bool.not false = true
Bool.not true = false
Negate a function.
This can be useful in combination with List.filter
/ Array.filter
or List.find
/ Array.find
Examples
let isLessThanTwelve = Bool.negate (fun n -> n >= 12) in
isLessThanTwelve 12 = false
Test for the equality of two bool
values.
Examples
Bool.equal true true = true
Bool.equal false false = true
Bool.equal false true = false