package tablecloth-native
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=0c71dd4035d6fa4978baabc3c932dba3
sha512=44ba09f1ff43e61403703cc244e91e0f8062bd9da998f031430d701a4de148b02878f7f881303f6ded261176f21926ab5ba00a313510ed8e2d2f252b3fd00054
doc/tablecloth-native/Tablecloth/Bool/index.html
Module Tablecloth.Bool
Functions for working with boolean (true or false) values.
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
*)Create
Basic operations
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) = trueBool.(true && false) = falseBool.(false && true) = falseBool.(false && false) = falseThe 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) = trueBool.(true || false) = trueBool.(false || true) = trueBool.(false || false) = falseThe exclusive or operator.
Returns true if exactly one of its operands is true.
Examples
Bool.xor true true = falseBool.xor true false = trueBool.xor false true = trueBool.xor false false = falseval not : t -> boolNegate a bool.
Examples
Bool.not false = trueBool.not true = falseConvert
Compare
Test for the equality of two bool values.
Examples
Bool.equal true true = trueBool.equal false false = trueBool.equal false true = false