Simple Types

The simple types in Bach are Null, Bool, Num, and Str. The following table shows some examples of programs that evaluate to a value of each type.

ProgramTypeValueError
nullNullnull
falseBoolfalse
trueBooltrue
42Num42
0.3Num0.3
"Hello world!"Str"Hello world!"

The Null type has a single value, null.

The are two Bool values: true and false.

Num values are IEEE754 double-precision floating-point numbers.

Str values are sequences of bytes.