Boolean functions

The type Bool is a built-in type defined as:

type Bool
  | True
  | False

There are a number of built-in operators defined on values of type Bool, e.g., &&, ||, and the if expression.

not : Bool -> Bool

The not function returns the negated value of its input.

Examples

val a = not True
//    = False
val b = not False
//    = True

equal : a -> a -> Bool

The equal function returns True if the two elements provided to it are equal, and False otherwise.

Examples

val a = equal 5 6
//    = False
val b = equal (3.14, 5) (3.14, 2 + 3)
//    = True