Other kinds of data

Hope provides two other primitive data types. A truval (truth value) is equivalent to a Pascal Boolean and has values true and false. We've already seen the expression x > y defining a truth value. > is a standard function whose type is num # num -> truval. We can use truth values in conditional expressions and combine them together with the standard functions and, or and not.

Single characters are of type char, with values 'a', 'b' and so on. Characters are most useful as components of data structures such as character-strings.



Roger Bailey <rb@doc.ic.ac.uk>