Type

When we say that a value V is of type X, we imply the existence of a set of values: all those (and only those) which can be described as being of type X. Conversely, if we construct a set of values, Y, all the values in Y are of type `Value that belongs to set Y'. Every type, thus, has a corresponding set of values and every set a corresponding type. If we agree to give the name, X, to the set corresponding to type X, and to refer to the members of set Y as being of type Y, we can equate type with set.

Therefore, when we speak of a variable Z as being of type X, we are constraining the variable to represent a value which belongs to set X. Likewise, we can refer to the domain of a one-parameter function as the type of its parameter and to the co-domain of a function as the type of its result (constraining the values that the parameter and result variables may represent, to be one of a specified set of values).

Referring to the page on variable definition, for instance, we see that a type expression is used to indicate the type of a variable. A type expression is an ordinary expression, except that it must result in a collection of values. This collection can be finite or infinite, and is ordinary in every respect: It can be used in an expression, assigned to a variable, passed as a parameter and returned from a function.

See also: Standard Types , Type Definitions and Abstract Types.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.